Your challenge for this milestone is to create a meme generation app using UIImagePickerController
, UIAlertController
, and Core Graphics. If you aren’t familiar with them, memes are a simple format that shows a picture with one line of text overlaid at the top and another overlaid at the bottom.
Your app should:
UIImage
using Core Graphics.UIActivityViewController
.Both the top and bottom pieces of text should be optional; the user doesn’t need to provide them if they don’t want to.
Try to solve the challenge now. As per usual, there are some hints below in case you hit problems.
UIAlertController
with a text field inside.UIImage
first, then add the text on top.NSAttributedString
has keys to specify the stroke width and color of text, which would make it more readable – can you experiment to figure it out?OK, that’s enough hints – get coding!
TAKE YOUR SKILLS TO THE NEXT LEVEL If you like Hacking with Swift, you'll love Hacking with Swift+ – it's my premium service where you can learn advanced Swift and SwiftUI, functional programming, algorithms, and more. Plus it comes with stacks of benefits, including monthly live streams, downloadable projects, a 20% discount on all books, and free gifts!
Sponsor Hacking with Swift and reach the world's largest Swift community!
Link copied to your pasteboard.