Speed Up your iOS Development: Demystifying complex UIViews using Decorators

Pieces of advice to create complex views, reusing a simple layout

Image for post
Image for post

Implementing our features based on the designs

Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
From the left to the right: Your birthdate View, Favorite Music View, Friend requests view
Image for post
Image for post
Image for post
Image for post
Very generic UITableViewCell composed by a single UILabel

Discovering the power of the NSAttributedString

Simplify the layout

Image for post
Image for post
Layout composition of the generic UITableViewCell with one single UILabel

Reuse the same layout along with multiples views

Decorator

Move the logic as much as you can to the Decorator

Final Results

Image for post
Image for post
AttributedModule with 3 different cells reusing the same view layout
Image for post
Image for post

Conclusions

Flawless iOS

🍏 Community around iOS development, mobile design, and…

Thanks to Lisa Dziuba

Francisco Javier Trujillo Mata

Written by

iOS Developer. Developing with modules is wonderful. Ready to preach the marvellous world of Modules. Learning the PS2Dev as well. https://github.com/fjtrujy

Flawless iOS

🍏 Community around iOS development, mobile design, and marketing

Francisco Javier Trujillo Mata

Written by

iOS Developer. Developing with modules is wonderful. Ready to preach the marvellous world of Modules. Learning the PS2Dev as well. https://github.com/fjtrujy

Flawless iOS

🍏 Community around iOS development, mobile design, and marketing

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

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