SwiftUI TabView PageTabViewStyle prevent changing tab?

The solution from mentioned reference works, just the swipe is blocked not by gesture(nil), but by gesture(DragGesture()). And view should be full-tab-content-view-wide, like TabView { ForEach(0..<5) { idx in Text(“Cell: \(idx)”) .frame(maxWidth: .infinity, maxHeight: .infinity) .contentShape(Rectangle()) .gesture(DragGesture()) // this blocks swipe } } .tabViewStyle(PageTabViewStyle()) Tested with Xcode 12.1 / iOS 14.1 * and, of course, … Read more

How do I do weak linking in Swift?

Seems like I’ve figured out what you can do I used NSClassFromString() to check if class is available on device, i.e. if NSClassFromString(“UIBlurEffect”) { let blur = UIBlurEffect(…) //… } else { //… } It’s needed to make UIKit.framework (or another corresponding framework) optional. If you create Swift-based application in XCode6-BetaX, all the frameworks wouldn’t … Read more