1/31/2024 0 Comments Swiftui list vstackThis protocol basically defines an ID, which can be of any type, as long as it uniquely identifies each view. In SwiftUI, when you want to display a list of elements in a ForEach method, your data source needs to conform to the Identifiable protocol. So, we have decided to go with LazyVStack for the container view. However, LazyVStack proved to be more flexible in terms of the many scrolling requirements we have, and we also didn’t have to implement hacky solutions to remove the List separators on iOS 14. The scrolling was smooth and there were no visible glitches. Performance-wise, List and LazyVStack were very similar to the initial attachment views we implemented (images, GIFs, text). We thought List and LazyVStack were the two most interesting options. Since we were building a SwiftUI SDK, we decided against the UIKit options (unless absolutely necessary). And of course, you can also implement your own custom list view, which will load the newly displayed views on demand.Another approach would be to cheat a bit and fall back to the battle-tested UIKit solutions for displaying rich data, such as UICollectionView and UITableView.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |