![](/style/images/good.png)
![](/style/images/bad.png)
iOS & Swift
source link: https://www.raywenderlich.com/25836622-your-second-ios-swiftui-app
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
List View Fundamentals
Introduction
2:37 FreeLearn what’s in store for you as you build Your Second iOS and SwiftUI App. This course builds on the Your First App, and Programming in Swift courses.
List Rows
4:51 FreeA List is a View for organizing data into a scrollable column of rows, and a row can be any View! Before you can have a list, you need a reusable row.
Models & Views
4:59 FreeCollectively, the properties of a book will be our data model. A book’s image will be computed based on its stored model data.
SF Symbols
6:01 FreeReview how to add SF Symbols in SwiftUI, and dynamically add an SF Symbol based on a book’s title.
Challenge: Book Row
3:32 FreeWith your Book model and a simple Image View set up, it is time to provide a book to the view you’ll be using for each of your list rows.
Lists
3:25 FreeWith enough of your app built up for it to make sense to incorporate a List, it’s nearly as simple as hitting “Embed in List”!
Navigation
4:01 FreeUse NavigationLink and NavigationView to show a new detail view after tapping on a row in the list of books.
Challenge: View Reuse
4:56 FreeCreate a reusable view which you can use for your rows, and their detail views. The “details” will be the entirety of longer titles, and larger images.
Conclusion
0:45 FreeReview what you’re able to do with lists already, and get a couple of ideas for what you can start thinking about in order to apply SwiftUI Lists in the future.
Data Flow
Introduction
0:45In this part, you’ll be completing your Book type, and create more interactive views. Your app will look great in both light and dark mode, too!
Modal Views
7:04Use a modal sheet in your detail view to present an image picker, and bind the result to your library. Soon, your books can have cover photos!
Image Binding
7:58The reason the images you’re adding to your library are not showing up is Book Images currently only display symbols. Let’s fix that!
Color Schemes
5:41The accent color for an app will be applied to certain views, like button labels, to achieve a desired theme.
Confirmation Dialogs
3:12An Alert is a good solution for helping a user avoid an unintentional loss of data. Along with the “sheet”, it’s another type of modal View.
Challenge! After setting a book’s image, show the user a “delete” button, which will bring up your alert from the previous episode.
Model Objects
7:01Convert a Book instance into “Model Object”: a reference type that comes with the power of the Identifiable protocol.
Observable Objects
2:11Combine makes it easy to take an object, observe changes to its properties, and react to those changes, in SwiftUI.
To complete your detail view, make use of a TextField, binding it to a book’s micro-review. Then display the review in your list!
Conclusion
0:21You’ve given your app a bunch of new features in this part. You can interact with your library and books from multiple places, and your UI syncs right up!
Managing Rows
Introduction
0:40In this part, you’ll be adding and removing books from your library, and sorting and reorganizing them.
ForEach
3:03A List is not only for displaying a collection of similar views. That’s the job of ForEach! Employ them both in order to have more complex columns.
Create a sheet that will bring the user to a new view, where they can fill out the information for a new book to be added to their library.
Environment
7:22An environment is a storage container for potentially any information that multiple views need to function.
Environment Values
2:50The environment is not just a place for model objects! Learn how to access useful data via the EnvironmentValues structure.
Sections
9:59Lists offer customizable Sections, with headers and footers as needed. You’ll use a section for each of the two “readMe” options for a book.
Swipe Actions
4:33ObjectWillChangePublisher powers ObservedObject and EnvironmentObjects in SwiftUI. Use it to propagate ObservableObject changes to collections.
Delete & Move Rows
8:13Using modifiers on a ForEach, move books in your library or delete them. An Edit Button in the navigation bar can help with both.
Conclusion
1:32Let’s review some of what you’ve accomplished along the journey of creating Your Second iOS and SwiftUI App. There’s a new learning path in store for you, next!
Version history
iOS 15, Swift 5.5, Xcode 13 (Selected)
Nov 4 2021iOS 14, Swift 5.3, Xcode 12
Nov 3 2020iOS 13, Swift 5.1, Xcode 11
Oct 8 2019Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK