line 19: I used the documentation sample for AgeRangeService, but get a Compiler Error: Missing argument for parameter 'in' in call That was for SwiftUI. For UIKit, require in parameter. So code reformatted. Removes all errors except unknown isEligibleForAgeFeatures. All other questions remain. func testAgeRange() async -> Bool { if !isEligibleForAgeFeatures { // Which import needed ? return true // Not called from Texas } do { let response = try await AgeRangeService.shared.requestAgeRange(ageGates: 13, 15, 18, in: self) // Can I use the 4 gate instead ? ageGates: 4, 13, 18 // guard let lowerBound = response.lowerBound else { // // Allow access to under 13 features. // return false // } var lowerBound = 4 switch response { case .declinedSharing: print(User declined to share age.) return false case .sharing(let range): lowerBound = range.lowerBound ?? 4 print(User age range: (range.lowerBound ?? 0)-(range.upperBound ?? 99)) @unknown default: print( fatalError()) return false } var ok = false if lo
Topic:
UI Frameworks
SubTopic:
UIKit
Tags: