iOS Developers, this tutorial has the intention to make you forget building iOS apps that rely on a single storyboard.
In the past few years, iOS projects (and mobile projects in general) contained no more than 10–15 screens in total. A single storyboard was definitely a good option since it could fit all screens and still have a clean wireframe that was understandable for future and current developers.
But, these days a 10–15 screens project is counted as a small sized project. What happens is that most of the projects currently are containing 40+ screens. And this is where it becomes a real issue. You are working with a single storyboard, you add all the screens inside of it, and suddenly you start facing many performance issues and getting lost easily in the sea of controllers. Not to mention the frustration of the future developers that will inherit the project.
Recently, I have started working with the CleanSwift (VIP) Architecture that was inspired by Uncle Bob's book Clean Code: A Handbook of Agile Software Craftsmanship. In my opinion, Clean Code is a revolutionary paradigm that everyone should follow.
I have done some research and a few tests with this architecture and found the best and most organized way to handle the huge amount of screens. 👇
Using Multiple Storyboards
I will now explain to you how to use the multiple storyboard approach for your next projects. It's not something hard to understand and I hope you find this approach useful.
By analyzing the names of the screens, you will notice that they belong to some specific group. A group is formed from screens that have the same functionality. Each group will represent a separate storyboard. If you are still confused, just stay with me for a little more and everything will be cleared. 👇
From the above screen names we can create several groups:
- Auth - Login, Register, Forgot Password
- Posts - Posts Feed, Post Details, Post Gallery, Post Map, Create Post, Edit Post, Search Posts, Your Posts, Bookmarked Posts.
- Chat - Inbox, Search Inbox, Chat Room, Create Chat Room.
That means that we will need to create 4 storyboards (Auth, Posts, Settings, Chat) for this app. This approach creates a clean and understandable workflow even with twice as many screens.
That’s it from this tutorial and if it helped you please 👏 or share this story so others like you can find it. Thank you for your attention! 🚀
Check out my latest project:
HOT ODDS Each day, we generate a list of the hottest odds in the world. These are odds that have dropped the most…apple.co
Read more of my writing on Medium:
Many iOS apps use Google Maps. This is a very common feature, so I have decided to prepare an ultimate guide on the…medium.freecodecamp.org
Custom UIView with XIB file is a very common practice in iOS Development. Custom UIView classes don’t contain XIB files…medium.com
A Swift tutorial that will make your app available in Spotlight searchhackernoon.com