From the course: iOS Development Tips

Unlock this course with a free trial

Join today to access over 23,400 courses taught by industry experts.

Custom widgets with intents, part 3

Custom widgets with intents, part 3

From the course: iOS Development Tips

Custom widgets with intents, part 3

"

- [teacher] We've done a lot so far. Setting up a widget with a working user configuration for a bull value. That is the same for numbers and strings as well. But what if you want to selection list? You use an ENUM. I'll demonstrate by adding one more intent parameter to change the color of the background. We're going to also unwrap this intent in the widget instead of the view. So let's go back to the intent and we're going to do two things here. First of all, we're going to make an ENUM here. So I'm going to go over here where it says "plus" and use "new ENUM". And I'm going to have three cases here. There's always an unknown case. And so I'm going to put the three cases here, and those are three colors that I happen to have. One of which is light blue. The second one I have here is going to be green, and the third one is going to be ochre. And I'm also going to want to name this better than just ENUM, so I'm…

Inhalt