Your Second iOS & SwiftUI App, Episode 6: Lists | raywenderlich.com

With 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ā€!


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/25836622-your-second-ios-swiftui-app/lessons/6

Hello Again!!

I would like to ask you, why are you putting all the inits in a private var booksCache and then then in [Book] { booksCache }.
I tried with ā€˜simpleā€™ var books: [Book] = [ .init(title:......
as below:
Library
and works like this:

List(Library().books, id: \.title) { book in
			BookRowView(book: book)

Whats the catch here ??