From the course: SwiftUI Essential Training
Unlock the full course today
Join today to access over 23,200 courses taught by industry experts.
List interaction
From the course: SwiftUI Essential Training
List interaction
- [Instructor] We have a lot of lists going on here. If your list is a dynamic one, like the order list you can manipulate it with some modifiers. Let's look at two common ones, deletion and moving. Since we only have one really dynamic list and that's OrderView, we're going to head over there next. Okay and we can close up the preview for now. And let's go down towards the bottom of the code here and you'll see where we got our ForEach here. Okay, so you're going to use a ForEach. Right here we have a list. Lists on their own will not take the modifiers and only ForEach. So what you're going to have to do is change this around a little bit in terms of the code. And we're still going to want a list here. So there is a way of getting both. And that is that you're going to put the ForEach within the list. So I can just do List and then put a bracket and then put ForEach, delete that other bracket. And then I just…
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
-
-
-
-
-
-
-
-
-
Alerts5m 33s
-
(Locked)
Presenting sheets8m 47s
-
(Locked)
Tab bars4m 53s
-
(Locked)
Stack navigation9m 38s
-
(Locked)
Two-column navigation split view8m 36s
-
(Locked)
Three-column navigation split view7m
-
(Locked)
List interaction5m 46s
-
(Locked)
Challenge: Debugging2m 45s
-
(Locked)
Solution: Debugging10m 32s
-
-
-