This article is 11 years old

The content here might be outdated as technology and best practices evolve quickly. While the concepts may still be valuable, please verify the information against current documentation and standards.

TNColorScrollViewController - easy scrollview with different color views

github tncolorscrollviewcontroller

For a few iOS projects I needed a scrollview which had different UIViews with different background colors.  Because it came back regularly it became cumbersome to write the whole thing over and over again.  So yesterday I created a view controller which takes away the pain of writing it.

You can find the code on Github with a demo project on how to use it, but the steps are easy.

  1. Create an array with TNColorViewData objects and give it a background color or a reference to a custom UIView class (this class has to subclass TNColorView)

  2. Create a config object in which you add the array and have the possibility to set some extra properties so the view controller knows how to behave

  3. Present the view controller

  4. There is no step 4

If you have any requests, just put them in the comments or add an enhancement in the GitHub issue tracker!

Frederik Jacques - Author

About the Author

👋 Hi, I'm Frederik Jacques, a passionate iOS developer and entrepreneur with over a decade of experience building innovative mobile applications.

I love creating apps that solve real problems and bring joy to users. From educational tools to creative meme makers, I'm always exploring new ways to blend technology with user experience. When I'm not coding, you'll find me sharing insights about iOS development, app monetization, and the indie developer journey.