From the course: iOS Development Tips

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Replacing segmented controls

Replacing segmented controls

From the course: iOS Development Tips

Replacing segmented controls

- [Narrator] You've probably used the segment control before, like I have here in the example file on the bottom. It's great for some simple uses, but lacks flexibility. Besides using only text or single colored icons, it doesn't' even work in vertical. Let's look at another solution, using button arrays. I've set up for you a vertical staff view of buttons, though I could've laid this out, on a layout anywhere on this view. Open up the assistant editor. I've hooked up everything for you but the buttons. So control drag from the Pizza button, to the assistant editor. While you could use the stack view arranged subviews array, a more flexible option is a collection of outlets with the outlet collection selection. Now, since this is actually a stack view, I could use the arranged subviews array that's part of the stack view, but to make this flexible and you can use it with anything outside of a stack view and just do straight out of layout, I'm going to do it a different way. There's…

Contents