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.

Menus on UIButtons

Menus on UIButtons

- [Tutor] Sometimes buttons need more than one function. To help with that there's menus accessible from a button. Let's look how to set them up and I've got a little app here to do that which has a big add button and a bar button up here and let's see how I can make these things have been menus. So what I'm going to do is I'm going to go over here to viewcontroller.swift and you'll see here's my code. And I set up a couple of things for you ahead of time. We've got minus plus back color SF symbols already set up. We've got the outlets and actions set up for us. Our add button has an update label. I've done nothing with the bar button and I'll explain why a little later. And then we've got some color picker functionality 'cause what I want to do is add a background. And so this sets up the color picker to change the background color. So what we're going to do is set up a UI menu. Now, to set up UI menu you got to have UI menu…

Contents