Image for post
Image for post
Photo by Warren Wong on Unsplash

During my career as an iOS developer I wrote around 50 apps. Some of them were small and stayed in the stores just for several months, others stayed alive and got regular updates for years. I’m not a designer myself, I get designs from my clients or a third-party designer. And almost all designs I saw included custom back button on most screens.

Using iOS storyboards to develop UIs, I tried to find an easy way for the user to return to a previous screen, some kind of backward segue. …

Image for post
Image for post
Photo by Samson Vowles on Unsplash

Showing even simple pop-up dialogs requires several lines of code in Swift. When you have data validation or proper error handling, you have tens or even hundreds of places where you can show a pop-up. Let’s write several UIViewController extensions that’ll do the work for us. "Let's start!")

Showing Errors and Warnings

The first two extensions will show simple pop-ups with only one button. The difference will be only in the title. You can add some styling, but Apple doesn’t usually motivate developers to customise pop-up windows, so I’ll use the basic UIAlertController here:

As you can see, the title is predefined and can’t be changed, but it can be translated depending on the system locale. If you have files with localisations, you can do it this…

Image for post
Image for post
Photo by Anton Darius on Unsplash

When you write mobile apps in Swift, you usually have a lot of background work. I’ve been working as a mobile developer for almost 10 years and I can hardly remember a single project without Internet requests. Each Internet request requires time to be processed. Usually an unknown amount of time, possibly, endless.

If you do such work in the main or UI (which is the same) thread, your UI will get stuck. …


Alex Nekrasov

Game and software developer with more than 15 years experience. Founder and CEO at Mariposa Studios, freelancer.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store