Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.