DEV Community

Cover image for The journey to my first iOS app
Ted Presley
Ted Presley

Posted on

The journey to my first iOS app

I've always had an interest in developing mobile apps and previously published an Android app back in 2014 or so and struggled hard with it. It's been a few years since then so I figured I'd try my had at Swift development since I've been in a professional webdev role for about five years and learned a lot about understanding and working with different languages and frameworks. This led me to picking up a project I started back in 2016 called Motiv8me. Motiv8me originally existed as a web app, which can still be found here and I figured it would be a good starter project that's different than your traditional todo or journal app.

Where to start?

Let's get ready to rumble!

The Swift documentation of course! I didn't follow any guides or tutorials for this app, just started reading the docs as well as some creative googling to point me in the right direction, which was extremely helpful in figuring out how to create a new image to save on the device.

On to the low level details!

Don't count the minutes of the day, make the minutes of the day count

The app's code isn't very complicated, I have a couple storyboards, one for the main loop and another for creation of custom images. For the main loop, it really comes down to layering a UIImageView and two UILabels. The UIImageView and quote UILabel are on a 10 second loop which will change the image, quote, and font. There's also a couple tap gestures, single tap which will loop to another random image, quote, and font and double tap to pause on the current set. I've also implemented a way to create your own images by swiping up on the main loop and this is where some of the more complicated work came into play.

When writing the custom image functionality, I ran into a lot of issues with placement and making sure the live preview matched closely to the end image. I learned very quickly that there's no built-in way to tap on a UILabel and open the keyboard which led me to replacing the quote's UILabel with a UITextView for the edit capability. With that issue tackled, I moved on to creating the image and saving it to the user's device. Using the UIGraphics family of functionality from UIKit I rendered my layer into the image and... came out with the background image in the right spot but the quote and app labels were stuck in the top left. I came to find out that when using UIView.layer.render(in: CGContext) the origin location of the CGRects on the layers is ignored so I was able to solve that by putting the quote and app labels as subviews to the main UIImageView before rendering. This allows for me to correctly place all of the pieces before rendering the whole image.

So development's done, how do I get this out to users?

There's a great post on Medium by The Manifest that I used to help me through this process. It's mostly as simple as getting a developer account ($99 a year), setting up your app on App Store Connect (previously iTunes Connect), and then setting up your app for review and sale. You'll need some screenshots on the devices your app is targeting, an app icon, and some metadata (ex. description) for potential users to read to get interested in your app. Once you have all of the requisite information you can submit your app for review and it'll usually be up in the store in 24-48 hours after that assuming the review goes through successfully.

So what did I learn and where to go from here?

Honestly, I'm not sure why I didn't start sooner. Throughout the process I learned a lot about how to develop and debug Swift applications and I learned a lot about the iOS ecosystem. So far I've only had a few dozen downloads without any kind of marketing but I've also been able to release an update and have about 90% of the installed user base update within a day or two. At the end of the day, I'm hoping that I can have an impact, even if it's small, to someone's day and help those that may need a little motivation or inspiration to get through the day.

If you'd like to check out the app, you can do so here, it's available for both iPhone and iPad. I've also open sourced the code on Github if that's more your speed.

Top comments (1)

Collapse
 
provmusic profile image
Jared

Congrats on releasing your first app! You've made it further than many devs before you. What's next?