Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Justin Rich
Justin Rich
19,556 Points

iOS UI Components

What are the best practices for modularization of UI code in iPhone? I know in web many frameworks (ex React/Angular) have adopted component architecture to allow for the reusing of code ... is there a similar concept in Swift? Are there any good resources for learning about modularizing UI components or creating "Components" in iOS?

2 Answers

Brandon Maldonado Alonso
Brandon Maldonado Alonso
10,050 Points

There are a few libraries on GitHub to get some already code components if you don't want to build them again, an example could be this library I created for better layout code, night mode depending on brightness and some UI components: https://github.com/BrandonMA/SwifterUI Is not complete but you can check the code to see if there is something useful for you.

Justin Rich
Justin Rich
19,556 Points

Oh I don't mind building them myself ... I was just wondering if there's a design pattern for making components in iOS. Specifically folder structures, organization of code, etc.