From the course: iOS Development: Siri Shortcuts

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Solution: Displaying size and total

Solution: Displaying size and total - iOS Tutorial

From the course: iOS Development: Siri Shortcuts

Start my 1-month free trial

Solution: Displaying size and total

(upbeat music) - Hopefully you were able to solve the challenge. If not, don't worry, we're going to implement it together. You already know that we are adding the invocation phrase, as well as the content description, and in order to display the size and the total, we have to simply change the content description. The first thing we need is to get the size from our coffee size enumerated type. But the eNom values, you can see, are integers, so we can't really assign the size zero, one, or two. We need a way to assign the size as string. So let's go ahead and add an extension to our coffee size, and inside the extension we can add a title property. A title property is going to return the string representation of the coffee size. Inside the title property, we are going to switch on itself, which means that it's going to switch on the coffee size eNom itself. We're going to start with our first case, which in this case is…

Contents