[ACCEPTED]-SwiftUI 4 List initializer not available in iOS-ios16
Accepted answer
You probably forgot to make selection as 1 Optional
, ie.
@State private var lastTab: Int? = 0 // << here !! `Int?`
List(tabs, selection: $lastTab) {tab in
// ...
}
Verified with: Xcode 14b3 / iOS 16
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.