Containing Child View Controllers in iOS Apps

Place a ViewController in another

Steven Curtis
4 min readApr 1, 2021

Difficulty: Beginner | Easy | Normal | Challenging
This article has been developed using Xcode 12.4, and Swift 5.3.2

There are many reasons that you might wish to reduce the amount of code and complexity contained within any particular view controller.

One approach that you should have in your amoury is that of splitting a view controller into mutliple smaller ones — but we should be careful of HOW we do tht in order to avoid just moving code around and instead put code into more sensible homes.

this article, hopefully, can help you out

If you would like to download the repo, it’s right HERE. The supporting video is right HERE for you.

Prerequisites

Terminology

  • UIViewController: A view controller is an intermediary between the views it manages and the data of your app
  • UIView: Presents information to the user. Views are, well, UIViews and their subclasses. Think of it as the UI components that have to be controlled by the controller

--

--

Responses (1)