Post

Replies

Boosts

Views

Activity

SwiftUI NavigationLink pops out by itself
I have a simple use case where a screen pushes another screen using the NavigationLink. There is a strange behaviour iOS 14.5 beta where the pushed screen is popped just after being pushed. I manage to create a sample app where I reproduce it. I believe the cause is the presence of @Environment(\.presentationMode) that seem to re-create the view and it causes the pushed view to be popped. The exact same code works fine in Xcode 12 / iOS 14.4 Here is a sample code. swift import SwiftUI public struct FirstScreen: View {   public init() {}   public var body: some View {     NavigationView {       List {         row         row         row       }     }   }   private var row: some View {     NavigationLink(destination: SecondScreen()) {       Text("Row")     }   } } struct SecondScreen: View {   @Environment(\.presentationMode) var presentationMode: BindingPresentationMode   public var body: some View {     VStack(spacing: 10) {       NavigationLink(destination: thirdScreenA) {         Text("Link to Third Screen A")       }       NavigationLink(destination: thirdScreenB) {         Text("Link to Third Screen B")       }       Button("Go back", action: { presentationMode.wrappedValue.dismiss() })     }   }   var thirdScreenA: some View {     Text("thirdScreenA")   }   var thirdScreenB: some View {     Text("thirdScreenB")   } } struct FirstScreen_Previews: PreviewProvider {   static var previews: some View {     FirstScreen()   } }
55
2
58k
Jul ’23
"Unknown error occurred" when running a Siri Shortcut
Hi, I've had a Siri Shortcut in my app for a while and everything was working fine. Recently, I started to get the error "Could not run xxxx, Unknown error occurred" when running that shortcut in the appstore version of my app. When I build and run my app locally, the shortcut works as expected and I can't figure out why it's not working in the Appstore/Release app. When I attach the device and run the appstore app with the Console app open, I see the following warning -[WFActionRegistry createActionsWithIdentifiers:serializedParameterArray:]_block_invoke_3 Action com.mycompany.MyApp.MySiriIntent is missing -[WFAction runWithInput:userInterface:runningDelegate:variableSource:workQueue:completionHandler:]_block_invoke_3 Action <WFHandleDonatedIntentAction: 0x7b8d48400, identifier: is.workflow.actions.sirikit.donation.handle> finished with error {domain: WFIntentExecutorErrorDomain, code: 103}. Error Domain=WFIntentExecutorErrorDomain Code=103 UserInfo={NSLocalizedDescription=<private>, WFIntentExecutorIntentResponseErrorKey=<private>, WFIntentExecutorIntentErrorKey=<private>, NSLocalizedFailureReason=<private>} I'm not sure if this is actually an issue but I do not get this second warning when running a local Debug build of the app. I double checked, and I my SiriKit and SiriUI do declare the intents in their info.plist <key>NSExtension</key> <dict> <key>NSExtensionAttributes</key> <dict> <key>IntentsSupported</key> <array> <string>MySiriIntent</string> </array> </dict> <key>NSExtensionMainStoryboard</key> <string>MainInterface</string> <key>NSExtensionPointIdentifier</key> <string>com.apple.intents-ui-service</string> </dict> <key>NSExtension</key> <dict> <key>NSExtensionAttributes</key> <dict> <key>IntentsRestrictedWhileLocked</key> <array> <string>MySiriIntent</string> </array> <key>IntentsSupported</key> <array> <string>MySiriIntent</string> </array> </dict> <key>NSExtensionPointIdentifier</key> <string>com.apple.intents-service</string> <key>NSExtensionPrincipalClass</key> <string>$(PRODUCT_MODULE_NAME).IntentHandler</string> </dict> I did not do any code changes in my Siri extensions in a while so I don't think the issue comes from a code change. Any idea what that error code 103 is? thanks for your help
0
0
1.4k
Jan ’23