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 - iOS Tutorial
From the course: iOS Development: Siri Shortcuts
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Understanding the structure of the app1m 55s
-
(Locked)
Creating shortcut using NSUserActivity3m 53s
-
(Locked)
Setting up developer options2m 8s
-
(Locked)
Restoring the app using shortcuts5m 14s
-
(Locked)
Adding voice shortcut1m 53s
-
(Locked)
Challenge: Displaying size and total29s
-
(Locked)
Solution: Displaying size and total3m 21s
-
(Locked)
-
-
-
-