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

how to implement a sliding segmented control.

in a project of mine i am running out of space on the sides for one of my segmented controls so i want to make it slide from side to side. I've been looking all over google and the docs and i cant seem to figure out a way to do this. so can anyone in the treehouse community help me in any way?

p.s. im in swift

1 Answer

You could embed it in a scroll view but I would recommend a horizontal collection view instead - allows you to style things the way you want without the constraints of a segmented control. You'll have to set up either a custom class or have an additional array of booleans to keep track of whether or not the item is checked but gives you a lot more freedom.