From the course: iPadOS 13 Development Essential Training
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Solution: Add an image - iOS Tutorial
From the course: iPadOS 13 Development Essential Training
Solution: Add an image
(bouncy music) - [Instructor] So here is my solution to the challenge and of course you will likely have come up with a different solution with different images and of course a different layout for the images. So here, in my item struct, I'm going to create a string called image. And then in my array of items I'm going to add images. I'm going to use strings that I got from Apple's stock images. So you'll use gamecontroller and then I'm going to select this and just copy and paste it a few times. And then I'll go to helm, scope, headphones, and tornado. And then what I want to do is actually use these items. So inside of my navigation link I'm going to create an image, and I'm going to do that with a system name, and that's going to come from item.image. I'll wrap these in an HStack, and them I'm going to apply some padding to the image. So just the default padding, like that. And we can preview it at this point. So…
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)
SwiftUI basics4m 46s
-
Previewing multiple platforms in SwiftUI2m 53s
-
(Locked)
Using SwiftUI to create navigation4m 10s
-
(Locked)
Creating a SwiftUI navigation model3m 4s
-
(Locked)
Setting a default selection2m 58s
-
(Locked)
Working with unsupported views in SwiftUI2m 24s
-
(Locked)
Challenge: Add an image1m 43s
-
(Locked)
Solution: Add an image2m 44s
-
(Locked)
-
-
-
-
-