SwiftUI: Meme Creator

Brandon Baars
The Startup
Published in
7 min readOct 27, 2020

--

Using SwiftUI, create memes from a blank template

This is what we will accomplish in this tutorial

Using a public API from https://imgflip.com/api, we will pull popular meme templates and give the user the ability to enter in their desired text and adjust as necessary.

We will use Combine to fetch the results, SwiftUI to display the information, and a few custom views for the user to edit it accordingly.

We won’t cover saving the image in this tutorial, but you could still just screenshot and crop it to fit your needs.

Getting Started

Create a new SwiftUI Project in Xcode. Make sure you’re running macOS Catalina and have Xcode 12 installed as we will be using parts of the iOS API that are only available in iOS 14.

Open Xcode → File → New → Project

I called mine MemeGenerator, but feel free to name it whatever you’d like.

Make sure you have User Interface set to SwiftUI.

--

--

Brandon Baars
The Startup

Software Engineer | React Native | NestJS | UI/UX