Post

Replies

Boosts

Views

Activity

iOS 16.4 NavigationStack Behavior Unstable
I've tested the behavior of NavigationStack in iOS 16.4 and found that it doesn't work in my already published app. Of course, my app works perfectly fine with the NavigationStack in iOS 16 to iOS 16.3. I'm not sure about the cause, but when tapping on a NavigationLink in a very large and complex navigation hierarchy, the corresponding navigationDestination doesn't transition the screen and instead gets caught in an infinite loop. Has anyone else experienced similar issues? I'd like to prepare a sample program to reproduce the issue, but it doesn't occur in simple view hierarchies, so I haven't been able to prepare one yet. Although the release notes for iOS 16.4 mention changes related to the performance of the NavigationStack, I suspect that some instability has been introduced. This behavior reminds me of the unintended automatic pop issue in the NavigationView of iOS 15. In the iOS 16.4 environment, I am planning to revert to using NaviagtionView. Once I have prepared a sample program to reproduce the issue, I will update again. There are bugs in NaviagtionView as well, but in the iOS 16.4 environment, I am temporarily planning to revert to using it. Once I have prepared a sample program to reproduce the issue, I will update again.
9
10
5k
Mar ’23
Product.SubscriptionInfo.status(for:) is sometimes empty even though a subscription has been registered
My app calls Product.SubscriptionInfo.status(for:) to get the subscription status when the app starts. Users with multiple Apple IDs have reported that every few days they get an unpurchased status, and when I checked that, the Product.SubscriptionInfo.status(for:) result array was empty. (When the app is restarted, Product.SubscriptionInfo.status(for:) gives the correct result.) StoreKit.Transaction.currentEntitlements, which is executed immediately after Product.SubscriptionInfo.status(for:), seems to be getting the correct result, so I am trying to check the subscription status with this result. Is it a bug that Product.SubscriptionInfo.status(for:) returns an empty result for the purchaser? There is a mismatch between Product.SubscriptionInfo.status(for:) and StoreKit.Transaction.currentEntitlements. Is it possible for a mismatch to occur?  And In such a case, which result should be adopted?
1
0
922
Nov ’22
NavigationLink in NavigationStack doesn't work on iOS 16.0 and iOS 16.1 beta
The following sample code doesn't work as expected. In addition, the behavior differs between iOS 16.0 and iOS 16.1 beta. If there is a workaround, please let me know. (I know that navigationDestination(isPresent:destination:) can be substituted in iOS 16.0, but it doesn't work in iOS 16.1 beta) I reported this issue (FB11599516). @main struct StackViewSampleApp: App {     var body: some Scene {         WindowGroup {             NavigationStack {                 ContentView()             }         }     } } struct ContentView: View {     var body: some View {         VStack {             NavigationLink("SubView") {                 SubView()             }         }         .navigationDestination(for: Int.self) { v in             DetailView(value: v)         }     } } struct SubView: View {     var body: some View {         NavigationLink(value: 1) {             Text("DetailView")         }         .navigationTitle("SubView")     } } struct DetailView: View {     let value: Int     var body: some View {         Text("\(value)")             .navigationTitle("Detail")     } } Actual behavior iOS 16.0 behavior / Xcode Version 14.0 (14A309) Pressing "SubView" button in RootView, it goes to SubView. Pressing "DetailView" button in SubView, it goes to DetailView. Pressing "Back" button, it goes to RootView. (Expect: it goes to SubView) iOS 16.1 beta(20B5045d) / Xcode Version 14.1 beta 2 (14B5024i) Pressing "SubView" button in RootView, it goes to SubView. Pressing "DetailView" button in SubView, it goes to SubView. Pressing "DetailView" button in SubView, it goes to SubView. (Repeat) (Expect: it goes to DetailView) Pressing "Back" button in SubView, it goes to DetailView. (Expect: it goes to a previous view)
3
0
1.6k
Sep ’22
navigationDestination(isPresent:content) in NavigationStack doesn't work on iOS16.1 beta
Hi, I've just finished replacing to NavigationStack, but I'm having trouble with this issue. The following simple sample code works on iOS 16.0 production, but it doesn't work on iOS 16.1 beta. When navigationDestination(isPresent:) is called, Xcode displays runtime warning message, but I cannot understand what the means. A `navigationDestination(isPresented:content:)` is outside an explicit NavigationStack, but inside the detail column of a NavigationSplitView, so it attempts to target the next column. There is no next column after the detail column. Did you mean to put the navigationDestination inside a NavigationStack? I didn't use NavigationSplitView and navigationDestination(isPresent:) is inside NavigationStack. Could someone please point out the problem with this code? Or is it a SwiftUI bug? Test environment Xcode Version 14.1 beta 2 (14B5024i) iPhone SE (3rd gen) (iOS 16.1) Sample Code @main struct StackViewSampleApp: App {     var body: some Scene {         WindowGroup {             NavigationStack {                 ContentView()             }         }     } } struct ContentView: View {     var body: some View {         List {             NavigationLink("SubView1") {                 SubView1()             }             NavigationLink("SubView2") {                 SubView2()             }         }     } } struct SubView1: View {        @State private var isPresent: Bool = false      var body: some View {         Button("A") {             isPresent = true         }         .navigationDestination(isPresented: $isPresent) {             Text("TEST")         }     } } struct SubView2: View {     enum ViewType {         case a, b, c     }     @State private var selection: ViewType? = nil     let viewTypes: [ViewType] = [.a, .b, .c]     var body: some View {         List(selection: $selection) {             ForEach(viewTypes, id: \.self) { t in                 NavigationLink(value: t) {                     Text("\(String(describing: t))")                 }             }         }         .navigationDestination(isPresented: .init(get: {             selection != nil         }, set: { newValue in             if !newValue {                 selection = nil             }         })) {             Text("\(String(describing: selection))")         }     } }
3
0
2.0k
Sep ’22