Little chance that you will find iOS developer, who hasn’t heard about child view controllers. But this undervalued functional remains not very popular in daily usage, while creating custom and complex interfaces.

The main benefits of using child view controllers:

Configure interfaces depending on screen size of iPhone

Photo by Julian O’hayon from Unsplash

Nowadays iOS developers must support around 6 different screens sizes of iPhones. This often requires to use different values when building interfaces for smaller and bigger devices. Usually, if you’re building interface from code, it looks like this somewhere in your view class:

This bunch of if/else doesn’t look sexy, and even worse, it has a chance to expand if you need to cover other devices separately. And when you have custom UI in your app, often you would need to provide such an approach in almost all of your screens.

How to implement interactive, distinguished interface considering possibilities of UIKit

Presentation of result

There are two main things, that I will demonstrate and explain in this article:

UIKit supplies us with a short amount of built-in transitions, that we regularly use while implementing a transition from one view controller to another. The most popular are modal present and navigation push. Because of their simpleness and wide common usage, such transitions could be boring and won’t make users excited in case when app’s design is fully custom.
A great solution would be to use possibilities of UIViewControllerAnimatedTransitioning and UIViewControllerInteractiveTransitioning protocols that stand for creating custom interactive transitions.

The second thing is about frequently used…

Serhii Kharauzov

 iOS/macOS Software Engineer

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