Post

Replies

Boosts

Views

Activity

Replacing top view in navigation stack
Hello. I use NavigationStack for navigating in app. I have 4 screens - A, B, C, D. In some moment I have path [A, B, C] for NavigationStack. After user did action I should show path [A, B, D]. In other hands I should replace screen C with screen D. struct HomeView: View { @ObservedObject var viewModel: HomeViewModel var body: some View { NavigationStack(path: $viewModel.path) { ContentView() .navigationDestination(for: HomeViewModel.Path.self) { destination in // B, C, D views here... } } .navigationViewStyle(StackNavigationViewStyle()) } } Solution looks like same as for UIKit. I replaced last item in stack. It works, but "push" animation broke. var updatedPath = self.path updatedPath.removeLast() updatedPath.append(newPathItem) self.path = updatedPath I found suggest in Internet that you can remove view from stack after some delay. But it has some magic. For example 1 second delay works properly on iOS 18, but cause crash on iOS 16. 1 millisecond delay works on iOS 16, but sometimes didn't. self.path.append(newPathItem) DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(1000)) { UIView.setAnimationsEnabled(false) self.path.remove(at: self.path.count - 2) DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(1)) { UIView.setAnimationsEnabled(true) } } It is easy task to replace current top screen in UINavigationController of UIKit. How I can do it properly in SwiftUI and save animation?
0
1
88
Mar ’25
SKErrorDomain Code=0 while app review
I have problems with review process for new app. Review team getting error "SKErrorDomain Code=0 unknown error" while purchase subscription. They using iPad/iPhone with iOS 17/18. Problem is not reproducible on my devices. Also on devices of testers team. I have tested debug builds from Xcode and production builds from TestFlight. So strange that same purchase code was reviewed successfully on 2 other my apps. Review team getting error only on one new app. On screenshots from review I can see product prices. I loading it via StoreKit on fly. It is mean that app found products for purchase but can't purchase. "SKErrorDomain Code=0 unknown error" how I see is not app error. It is StoreKit error. Most popular advice in internet is just resubmit build. I tried it but get back same message from review team. That should I do in this case?
0
1
318
Oct ’24
EXPIRED notification is no longer received
Hello, I have configured V2 server notifications for my applications. I am receiving different types of notifications (https://developer.apple.com/documentation/appstoreservernotifications/notificationtype) in my webhook. Something changed after November 18th. EXPIRED notifications are no longer received. Has something changed in the API? Other notification types still work.
2
0
793
Dec ’23