Building out a horizontal scrollview carousel mechanism in SwiftUI is surprisingly very easy compared to the UIKit UICollectionView counterpart. I'll first show you how to implement this using ScrollView, HStack, and ForEach loops. Finally once we have our views rendered out as map items, we'll discuss how to properly handle the selection of each block so that the map reacts correctly.
Comments (2)
Setwork44
3 years ago
Just downloaded the project, where was that bit of code that prevents the flashing?
shivaskanthan
3 years ago
For anyone trying to avoid the deprecation warning use this:
UIApplication.shared.windows.first(where: {$0.isKeyWindow})?.endEditing(true)