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.

Button selection panels in SwiftUI

Button selection panels in SwiftUI

From the course: iOS Development Tips

Button selection panels in SwiftUI

- [Instructor] Last tip, I got my static layout for a ship's tablet from a sci-fi novel worked out. Now I want to select one of those buttons, like a segmented control. However, this is a vertical, not horizontal, so segmented controls don't work. So instead, I'm going to build a button panel. Now, in the exercise file there's a new copy of the ship's tablet we've been working on with more code and extra views in place. If you go ahead and you run it on an iPad Pro 9.7-inch, what you'll see is I can hit these buttons, and they can turn on but they're not selecting anything, and so what I'm going to do today is change this title up here to select the correct button, and only that button will light up. So what we're going to do is stop this, and I'm going to drop down here into the TabletButtonView, let's take a look at this, and you'll see that I've got a lot of code here. Some of it I've already commented out, and I'm…

Contents