Post

Replies

Boosts

Views

Activity

Reply to SwiftUI - ForEach in List shows the wrong row in detail with iOS 15 but the right one in iOS 14
I have similar issue, illustrated with this cut-down code and an alert in place of a sheet which always shows the first item, irrespective of the user selection. Its the same in iOS14 and 15. let items = ["One", "Two", "Three"] @State private var showAlert: Bool = false     var body: some View { List { ForEach(items, id: \.self) { item in Text(item) .onTapGesture() { showAlert = true } .alert(isPresented: $showAlert, content: { Alert(title: Text(item), message: Text(item), dismissButton: .default(Text("OK"))) }) } }     }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’21
Reply to URLSession can access password protected directory without credentials
Thanks Quinn, it was coming out of the cache, and adding your suggested cachePolicy fixes the issue. Incidentally, when I set up a delegate to handle an authentication challenge like this: func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { print("didReceive challenge \(challenge.protectionSpace.authenticationMethod), failure count: \(challenge.previousFailureCount)") completionHandler(.useCredential, nil) } func urlSession(_ session: URLSession, task: URLSessionTask, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { print("Task: \(task.taskIdentifier) didReceive challenge \(challenge.protectionSpace.authenticationMethod)") completionHandler(.useCredential, nil) } The output is: didReceive challenge NSURLAuthenticationMethodServerTrust, failure count: 0 didReceive challenge NSURLAuthenticationMethodServerTrust, failure count: 0 I'm not sure why I am not getting a NSURLAuthenticationMethodHTTPBasic challenge? Bill Aylward
Topic: App & System Services SubTopic: General Tags:
Sep ’21