Posts

Sort by:
Post not yet marked as solved
1 Replies
49 Views
Hi, I am on version 2.2.11 of my app and I need some specific things tested. Honestly, I haven't had much luck with friends downloading and testing my app. I want people who will push the limits of the first flow of my app to hopefully produce edge cases which I can then fix. I don't mind paying. Any there any good services I can use to buy a batch of testers? Is this approach above-board as far as Apple is concerned? Thanks, Ryan
Posted
by
Post not yet marked as solved
0 Replies
3 Views
This crash has been troubling us for a long time. We have this crash report in every release of our App, but can't reproduce it. Here is part of the crash info: Incident Identifier: xxxx Hardware Model: iPhone13,3 Process: MyApp [34550] Path: /private/var/containers/Bundle/Application/xxxx/MyApp.app/MyApp Identifier: ***.*** Version: *** (296) AppStoreTools: 15F31c AppVariant: 1:iPhone13,3:15 Code Type: ARM-64 (Native) Role: Foreground Parent Process: launchd [1] Coalition: ***.*** [466] Date/Time: 2024-05-19 13:59:10.9716 +0800 Launch Time: 2024-05-19 12:18:24.8753 +0800 OS Version: iPhone OS 16.6.1 (20G81) Release Type: User Baseband Version: 3.80.01 Report Version: 104 Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS at 0x322e323400000000 -> 0x0000003400000000 (possible pointer authentication failure) Exception Codes: 0x0000000000000001, 0x322e323400000000 VM Region Info: 0x3400000000 is in 0x1000000000-0x7000000000; bytes after start: 154618822656 bytes before end: 257698037759 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL commpage (reserved) fc0000000-1000000000 [ 1.0G] ---/--- SM=NUL ...(unallocated) ---> GPU Carveout (reserved) 1000000000-7000000000 [384.0G] ---/--- SM=NUL ...(unallocated) UNUSED SPACE AT END Triggered by Thread: 0 Thread 0 name: Thread 0 Crashed: 0 CoreGraphics 0x00000001bd1d0780 CGFontStrikeRelease + 76 (CGFontStrike.c:126) 1 CoreGraphics 0x00000001bd1dd0cc CGGlyphBuilderUnlockBitmaps + 476 (CGGlyphBuilder.cc:113) 2 CoreGraphics 0x00000001bd1eb8c8 render_glyphs + 412 (RIPContextDrawGlyphs.c:127) 3 CoreGraphics 0x00000001bd202ea4 draw_glyph_bitmaps + 1132 (RIPContextDrawGlyphs.c:210) 4 CoreGraphics 0x00000001bd21a0ec ripc_DrawGlyphs + 1320 (RIPContextDrawGlyphs.c:558) 5 CoreGraphics 0x00000001bd1d26d8 CG::DisplayList::executeEntries(std::__1::__wrap_iter<std::__1::unique_ptr<CG::DisplayListEntry const, std::__1::default_delete<CG::DisplayListEntry const> >*>, std::__1::__wrap_iter<std::__1::uniq... + 5852 (DisplayList.cpp:1657) 6 CoreGraphics 0x00000001bd1c86a8 CGDisplayListDrawInContextDelegate + 268 (DisplayList.cpp:2151) 7 QuartzCore 0x00000001bcc797d4 CABackingStoreUpdate_ + 468 (CABackingStore.cpp:1388) 8 QuartzCore 0x00000001bccf0c34 invocation function for block in CA::Layer::display_() + 64 (CALayer.mm:9699) 9 QuartzCore 0x00000001bcc78d54 -[CALayer _display] + 1720 (CALayer.mm:9732) 10 QuartzCore 0x00000001bcc785b4 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 412 (CALayer.mm:2521) 11 QuartzCore 0x00000001bcc898d8 CA::Context::commit_transaction(CA::Transaction*, double, double*) + 444 (CAContextInternal.mm:2714) 12 QuartzCore 0x00000001bccb8e80 CA::Transaction::commit() + 648 (CATransactionInternal.mm:432) 13 QuartzCore 0x00000001bcca2df0 CA::Transaction::flush_as_runloop_observer(bool) + 88 (CATransactionInternal.mm:940) 14 UIKitCore 0x00000001bdca34d0 _UIApplicationFlushCATransaction + 52 (UIApplication.m:3286) 15 UIKitCore 0x00000001bddf3d94 _UIUpdateSequenceRun + 84 (_UIUpdateSequence.mm:114) 16 UIKitCore 0x00000001be458894 schedulerStepScheduledMainSection + 144 (_UIUpdateScheduler.m:1015) 17 UIKitCore 0x00000001be457df0 runloopSourceCallback + 92 (_UIUpdateScheduler.m:1164) 18 CoreFoundation 0x00000001bb80a128 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28 (CFRunLoop.c:1957) 19 CoreFoundation 0x00000001bb8167b4 __CFRunLoopDoSource0 + 176 (CFRunLoop.c:2001) 20 CoreFoundation 0x00000001bb79b5e8 __CFRunLoopDoSources0 + 244 (CFRunLoop.c:2038) 21 CoreFoundation 0x00000001bb7b10d4 __CFRunLoopRun + 828 (CFRunLoop.c:2953) 22 CoreFoundation 0x00000001bb7b63ec CFRunLoopRunSpecific + 612 (CFRunLoop.c:3418) 23 GraphicsServices 0x00000001f6ccc35c GSEventRunModal + 164 (GSEvent.c:2196) 24 UIKitCore 0x00000001bdb42f58 -[UIApplication _run] + 888 (UIApplication.m:3782) 25 UIKitCore 0x00000001bdb42bbc UIApplicationMain + 340 (UIApplication.m:5372) 26 MyApp 0x000000010468f978 main + 80 (main.m:15) 27 dyld 0x00000001dace8dec start + 2220 (dyldMain.cpp:1165) Thread 1 name: Thread 1: 0 libsystem_kernel.dylib 0x00000001fa6f6ca4 mach_msg2_trap + 8 (:-1) 1 libsystem_kernel.dylib 0x00000001fa709b74 mach_msg2_internal + 80 (mach_msg.c:201) 2 libsystem_kernel.dylib 0x00000001fa709e4c mach_msg_overwrite + 540 (mach_msg.c:0) 3 libsystem_kernel.dylib 0x00000001fa6f71e8 mach_msg + 24 (mach_msg.c:323) 4 CoreFoundation 0x00000001bb7b0024 __CFRunLoopServiceMachPort + 160 (CFRunLoop.c:2622) 5 CoreFoundation 0x00000001bb7b1250 __CFRunLoopRun + 1208 (CFRunLoop.c:3005) 6 CoreFoundation 0x00000001bb7b63ec CFRunLoopRunSpecific + 612 (CFRunLoop.c:3418) 7 Foundation 0x00000001b5a2efb4 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212 (NSRunLoop.m:373) 8 Foundation 0x00000001b5a2ee9c -[NSRunLoop(NSRunLoop) runUntilDate:] + 64 (NSRunLoop.m:420) 9 UIKitCore 0x00000001bdc75cc8 -[UIEventFetcher threadMain] + 416 (UIEventFetcher.m:1376) 10 Foundation 0x00000001b5a48524 __NSThread__start__ + 716 (NSThread.m:963) 11 libsystem_pthread.dylib 0x000000021b5766b8 _pthread_start + 148 (pthread.c:893) 12 libsystem_pthread.dylib 0x000000021b575b88 thread_start + 8 (:-1) Thread 2: 0 libsystem_kernel.dylib 0x00000001fa6f7164 __semwait_signal + 8 (:-1) 1 libsystem_c.dylib 0x00000001c2c50888 nanosleep + 220 (nanosleep.c:104) 2 libsystem_c.dylib 0x00000001c2c61b1c sleep + 52 (sleep.c:62) 3 MyApp 0x00000001075ccb14 -[UTDCacheManager synchronizeData] + 104 (UTDCacheManager.m:133) 4 Foundation 0x00000001b5a48524 __NSThread__start__ + 716 (NSThread.m:963) 5 libsystem_pthread.dylib 0x000000021b5766b8 _pthread_start + 148 (pthread.c:893) 6 libsystem_pthread.dylib 0x000000021b575b88 thread_start + 8 (:-1)
Posted
by
Post not yet marked as solved
0 Replies
22 Views
Hello, I am developing a Finder plugin for a MacOS application. It was working fine during development and testing on os version 14.4. However, when I tried running the application on os version 10.15, it notworking.If I run the plugin binary directly, it will crash. crash info: Time Awake Since Boot: 1100 seconds System Integrity Protection: enabled Crashed Thread: 0 Dispatch queue: com.apple.main-thread Exception Type: EXC_BAD_INSTRUCTION (SIGILL) Exception Codes: 0x0000000000000001, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Termination Signal: Illegal instruction: 4 Termination Reason: Namespace SIGNAL, Code 0x4 Terminating Process: exc handler [719] Application Specific Information: Configuration error: Couldn't retrieve XPCService dictionary from service bundle. Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libxpc.dylib 0x00007fff71b04bfb _xpc_copy_xpcservice_dictionary.cold.1 + 14 1 libxpc.dylib 0x00007fff71af2fcd _xpc_copy_xpcservice_dictionary + 106 2 libxpc.dylib 0x00007fff71af2e27 xpc_main + 61 3 com.apple.Foundation 0x00007fff3a0a5e6f -[NSXPCListener resume] + 155 4 com.apple.pluginkit.framework 0x00007fff6258decb 0x7fff62575000 + 102091 5 com.apple.pluginkit.framework 0x00007fff6258dbf4 0x7fff62575000 + 101364 6 com.apple.pluginkit.framework 0x00007fff6258e2b2 0x7fff62575000 + 103090 7 com.apple.Foundation 0x00007fff3a11eb4c NSExtensionMain + 49 8 libdyld.dylib 0x00007fff718a5cc9 start + 1 This issue just requires creating the simplest APP project + FinderSyncExtension project in Xcode 14.4 on macOS. Set the minimum supported system to 10.15 to reproduce the issue. How can I resolve it?
Posted
by
Post not yet marked as solved
0 Replies
14 Views
I am developing a VisionOS application with IAP which has not yet been submitted for review. In the process of development, while using the payment feature under the sandbox environment, the store returns the following error: explanation = "Purchasing is not currently available on this device in your country or region. Purchases you make on an iPhone, iPad or Mac can still be accessed here.\n\n[Environment: Sandbox]" How should I handle this? change another country or region ? thanks
Posted
by
Post not yet marked as solved
0 Replies
10 Views
We have taken the actions listed in the following URL. We would like to confirm if the review is approved. https://developer.apple.com/news/?id=pvszzano Is there any other way to check if it passes the review other than the actual review? We would like to do a preliminary review to make sure that what we have done is okay.
Posted
by
Post not yet marked as solved
0 Replies
16 Views
I've setup applinks for Universal Links purposes on my app. But I noticed that setting up applinks also sets up Password AutoFill. Upon logging in I don't want my users to be prompted to Save Password because of the way we use our subdomains. How can I disable Password AutoFill while retaining Universal Links capability, and without disabling secureTextEntry on my UITextField?
Posted
by
Post not yet marked as solved
0 Replies
17 Views
Basically I have tested in two device, it is working on iOS 15.7 and waiting for api response properly but when i am testing in iOS 16.6 Siri haven't wait for response and it was terminated itself and showing message Siri generated i.e. "I tried, but 'intentName' took too long to respond" and Siri stopped there.
Posted
by
Post not yet marked as solved
1 Replies
73 Views
Hi all, I am trying to measure the performce of my video game in iOS platform. After launching the debugger and caputre GPU workload (with "frame" selected as scope), I can not do performance profiling. The error message is: "Failed to enable shader profiler. (516)". And if I export the GPU trace and reopen it, the Xcode can not find any compatible devices connected. However, the same device used for capturing is connected. Device informations are: Mac device: MacBook Air M2, 2022 Mac OS version: Sonoma 14.4 XCode version: 15.2 (15C500b) mobile device: iPhone 13 Pro Max iOS version: 15.0 GPU performance counter can be performed using the same mobile device in my colleague's Mac. So I think there might be something wrong with my Xcode.
Posted
by
Post marked as solved
1 Replies
72 Views
Environment: Mac OS Sonoma v14.4.1 Xcode 15.3 I'm new to iOS Swift development environment and trying to create a simple app to just return the current location address. I'm testing it with simulator iPhone 15 but the app is not returning any result. Please advise. Here is my code. import SwiftUI import CoreLocation struct CurrentLocationView: View { @StateObject private var locationManager = LocationManager() var body: some View { VStack { Text("Your Address:") .font(.title2) Text(locationManager.address ?? "Locating...") .multilineTextAlignment(.center) .padding() } .onAppear { locationManager.requestAuthorization() } } } class LocationManager: NSObject, ObservableObject, CLLocationManagerDelegate { private let locationManager = CLLocationManager() @Published var address: String? override init() { super.init() locationManager.delegate = self locationManager.desiredAccuracy = kCLLocationAccuracyBest } func requestAuthorization() { switch locationManager.authorizationStatus { case .notDetermined: locationManager.requestWhenInUseAuthorization() case .authorizedWhenInUse, .authorizedAlways: locationManager.startUpdatingLocation() case .denied, .restricted: // Handle denied or restricted authorization print("Location services denied") default: break } } func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { guard let location = locations.first else { return } let geocoder = CLGeocoder() geocoder.reverseGeocodeLocation(location) { [weak self] placemarks, error in guard let self = self, let placemark = placemarks?.first else { return } // Extract address components if let thoroughfare = placemark.thoroughfare, let locality = placemark.locality { let address = "\(thoroughfare), \(locality)" self.address = address } else { self.address = "Unable to determine address" } } } } #Preview { CurrentLocationView() }
Posted
by
ktl
Post not yet marked as solved
1 Replies
65 Views
My Xcode workspace contains build settings for a macOS, iOS, and tvOS application. My Sandbox macOS app builds just fine and works great - and is on the App Store. I am in the process of creating a new build / branch of this app that is not Sandboxed so that I can add IPC (Syphon support) - as I don't think I can use App Groups to enable CFMessage support (which Syphon requires) because Syphon (third party framework) - uses its own naming convention for the ports. Anyway, sandbox support for a Syphon app is a topic for another day (it's actually quite disappointing that I can't release a Syphon version on the App Store). The trouble I am having, is that even afer deleting the App Sandbox entitlement from my project, my App still seems to be running in the App Sandbox, and I can't figure out how to remove the App Sandbox entitlement completely. What I am seeing, is that even after deleting the App Sandbox entitlement (using the project settings and deleting it in the "Signing and Capabilities" tab (and also checking the entitlements file manually to doubly make sure it is gone) - I am still seeing the following error message: *** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0x8703, name = 'info.v002.Syphon.332143F7-0916-428A-A88A-59B752F95304' See /usr/include/servers/bootstrap_defs.h for the error codes. It is also saving my Application Support data in the ~/Library/Containers folder, and not in ~/Library/ApplicationSupport What step am I missing?
Posted
by
Post not yet marked as solved
1 Replies
69 Views
Hi everyone, first-time caller, long-ti... wait, no, I just got here. :) I am relatively new to all things Apple, so apologies in advance if it takes me a few goes to properly explain things. We have a framework, which includes an API, an XPC service, etc, and we have a device driver. We also have some sample apps that use the framework, and if they have the app sandbox capability, then we expect them to use the XPC Service instead of accessing our driver directly. This works fine on Monterey and presumably has worked fine on all previous versions of MacOS. Something seems to have changed on Ventura, and we don't understand what. When we build the same app on Ventura, it appears to be in the sandbox (according to the Sandbox column in Activity Monitor), but in the Console there is this line (twice): default <time> <OurAppName> Revoking sandbox extension; key = 0 Which we suspect is linked to the fact that the app then does not use the XPC Service, and instead accesses the driver directly, much to our surprise. Software built on developer's machines is "Automatically managed" and "Signed to Run Locally" in case that matters. Do we need to change our code to support Ventura and onward? Or is it a bizarre bug? Oh, I should say that I'm running the latest version of Ventura (13.6.7 as of writing) but not the latest Xcode (14.2 (14C18)) and CLI tools... can't remember how to find that version... Apple clang version 14.0.0 (clang-1400.0.29.202). Any help would be appreciated, thanks. Jeremy
Posted
by
Post not yet marked as solved
0 Replies
56 Views
Hi, I'd received an invitation for test flight, but first, i need to join their development team. I'd received the email invitation for joining the team. Click "Accept Invitation", and prompt to log in. Success. But, I'd received "Cannot proceed with the request" message. Although, I'd try 2 different account tester. When, I click, "Contact Us". This page appeared. And I realize that, sometime, I didn't receive the invitation link although my teammate had sent it multiple times...
Posted
by
Post not yet marked as solved
0 Replies
56 Views
Hi, I am developing a drawing app using SafariView and is using apple pencil double tap handler for crucial features. In IOS 17.5 I lost functionality of it when interacting with SafariView, my friend confirmed that it worked with IOS 17.4 and I can confirm it also worked with IOS 17.1. However, I cannot downgrade my system nor can my uses. THIS IS A FATAL MALFUNCTION FOR MY APP. Detailedly, as I tested, the double tap handlers cannot be activated when my last tapped component is SafariView, so it never works when interacting with my web app. But I can enable this by clicking outside the SafariView or some non-SafariView component on top of it, just anything other than the Safari view, even webkit view can work but it is not usable for me. My aim is to keep listening to double tapping while interacting with SafariView in full screen, so I cannot let the user tap elsewhere to just activate double tap, there is no other walk around for me, unless there is a way to enable 120fps animation in WebKit view, which is only available in safari feature flags as I know. I would like to hear a solution in this situation or a promise of a fix, this is devastating to my users' experience. code to reproduce: import SwiftUI import WebKit import SafariServices struct SafariView: UIViewControllerRepresentable { let url: URL func makeUIViewController(context: Context) -> SFSafariViewController { return SFSafariViewController(url: url) } func updateUIViewController(_ uiViewController: SFSafariViewController, context: Context) { // No update code needed for this example } } struct WKWebViewWrapper: UIViewRepresentable { let url: URL func makeUIView(context: Context) -> WKWebView { let webView = WKWebView() let request = URLRequest(url: url) webView.load(request) return webView } func updateUIView(_ uiView: WKWebView, context: Context) { // No update code needed for this example } } struct ContentView: View { var body: some View { VStack { Image(systemName: "globe") .imageScale(.large) .foregroundStyle(.tint) .onPencilDoubleTap { value in print("tap1") } Text("Hello, world!") .padding() SafariView(url: URL(string: "https://www.example.com")!) .onPencilDoubleTap { value in print("tap2")} .frame(width:300) WKWebViewWrapper(url: URL(string: "https://www.example.com")!).onPencilDoubleTap { value in print("tap3") } .frame(width:300) } } } #Preview { ContentView() }
Posted
by
XLL
Post not yet marked as solved
1 Replies
61 Views
Hello I have a swiftUI/swiftData document based app. In this I have created a singleton object using the folllowing in my ContentView struct: @Query private var persistantStores:[PersistantStateManagerStorage] @State private var stateManager: PersistantStateManagerStorage? I then, call the following on the onAppear and onDisappear calls on the top level HStack{} item in my view .onAppear(){ if let store = persistantStores.first { self.stateManager = store // data.first } else { self.stateManager = PersistantStateManagerStorage() modelContext.insert(stateManager!) try? modelContext.save() } }.onDisappear(){ print("bye bye") self.stateManager = nil } I then wrap my view inside a if let stateManager = stateManager {} block to unwrap the optional, and bind to values with a call such as Stepper("Nudge Amount", value: Bindable(stateManager).nudgeAmount, in: 1...20) I have to use Bindable(stateManager) rather than $stateManager as the $stateManager doesn't know its been unwrapped All of this works fine until I close a document, at which point I get a crash with the message "SwiftData/BackingData.swift:124: Fatal error: Unable to get value - no backing Managed Object" which appears to happen when trying to access some of the properties of my persistantStore object (which has been retired) I assume that my persistantStore object being an optional is part of the problem but I can't work out a better method of doing what I am trying to do
Posted
by
Post not yet marked as solved
1 Replies
73 Views
I'm taking my iOS/iPadOS app and converting it so it runs on visionOS. I’m trying to compile my app, build it, for both visionOS and iOS. When I try to build for an iPhone and iPad simulator, I get the following error:  Building for 'iphonesimulator', but realitytool only supports [xros, xrsimulator] I’m thinking I might need to do a # if conditional compilation statement for visionOS so iOS doesn’t try to build lines of code but I can’t for this particular error find out for which file or code I need to do the conditional compilation. Anyone know how to get rid of this error? 
Posted
by
Post not yet marked as solved
0 Replies
64 Views
Has anyone used satellite imagery on WatchOS 10? I am trying to set the mapStyle ... .mapStyle(.imagery(elevation: .automatic)) ... for the map and it doesn't seem to have any effect, the map is just the standard map style. The documentation for mapStyle indicates that it is available. Any help would be appreciated. Ultra 2, WatchOS 10.4, Xcode 15.3
Posted
by
Post not yet marked as solved
1 Replies
80 Views
I am developing an App. There are multiple windows in it. A main window that shows the main UI of the app, and some other util windows that are created dynamically when needed. All of these windows have their rootviewcontrollers, and they all support all the userinterface orientations. But when I rotate the device, the windows seemed rotate to the right orientation, but some window has four strange black rectangles along each side. And the worse thing is that the whole app become freezed, it does not respond to touch event, I need to force quit it. I did a lot of experiments to find out the cause of this issue in last two months. I found some truth about this issue: Good Case: If the App only has the main window, the issue gone. If the rotation animation completed, the issue gone. the attachment shows some callstacks when rotation animation completed. goodcase-animation-callstacks Bad Case: When the issue occurs, I find out the rotation animation does not complete. This is some code of rootviewcontroller: - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator { [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator]; NSLog(@"%s, size: %@", __PRETTY_FUNCTION__, NSStringFromCGSize(size)); NSLog(@"%@", NSThread.callStackSymbols); NSLog(@"%@", self.view); NSLog(@"%@", self.view.subviews); [coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> _Nonnull context) { NSLog(@"animation block"); fprintf(stderr, "stderr animation block\n"); fprintf(stdout, "stdout animation block\n"); NSLog(@"%@", NSThread.callStackSymbols); NSLog(@"animation block SDL_uikitviewcontroller runloop mode: %@", NSRunLoop.currentRunLoop.currentMode); NSLog(@"%@", self.view); NSLog(@"%@", self.view.subviews); } completion:^(id<UIViewControllerTransitionCoordinatorContext> _Nonnull context) { NSLog(@"completion block, isCancelled: %@", context.isCancelled ? @"YES" : @"NO"); fprintf(stderr, "stderr animation completion block\n"); fprintf(stdout, "stdout animation completion block\n"); NSLog(@"%@", NSThread.callStackSymbols); NSLog(@"animation complete block SDL_uikitviewcontroller runloop mode: %@", NSRunLoop.currentRunLoop.currentMode); }]; [coordinator notifyWhenInteractionChangesUsingBlock:^(id<UIViewControllerTransitionCoordinatorContext> _Nonnull context) { NSLog(@"%s", __PRETTY_FUNCTION__); }]; } I guess this issue is similar to another common issue: UINavigationController push/pop viewcontroller when previous push/pop animation is running, or showing a UIAlertController when viewcontroller is being pushing/popping They all have the same result, the app become unresponsive to touch events, but they can respond to other events(I did some test, the app is still running, not in a deadlock state, it just can not respond to touch events) I guess the root cause of this issue is the animations conflict, or the view hierarchy changed when animating, so the animation states and the view hierarchy were messed up. But I don't know how to fix it. I have a workaround, but it has side effect.
Posted
by
Post not yet marked as solved
0 Replies
76 Views
Hello everyone. I am developing an application with SwiftUI. I am having trouble with NavigationStack(path: ). 1st problem: After the application runs, after clicking on the first list item, there is a flicker in the title section. I think it is the .navigationDestination that causes this problem, because when I change the navigationLink to Button in the “ActiveRegQueryView” screen, this problem disappears. 2nd Problem: When you click on a list item, sometimes it stays pressed (grayed out) and does not take you to the screen (Video 1). If you try to click on an item more than once, navigatinLink passes more than one value to path and opens more than one page (I noticed this with path.count) (Video 2). I don't have this problem if you edit the back button on the screen it takes you to (ActiveRegDetailView). (vm.path.removeLast()) The reason I use path is to close multiple screens and return to the start screen. Video 1: Video 2: Main View: import SwiftUI struct ActiveRegView: View { @Environment(NavigationViewModel.self) private var navViewModel @AppStorage("sortOption") private var sortOrder: sorting = .byBrand @State private var searchText = "" var body: some View { @Bindable var navViewModel = navViewModel NavigationStack(path: $navViewModel.path) { // <- if i don't use path everything is OK List { ActiveRegQueryView(searchText: searchText, sortOrder: sortOrder) // <- Dynamic Query View } .navigationDestination(for: Registration.self, destination: { ActiveRegDetailView(reg: $0) .toolbar(.hidden, for: .tabBar) }) } } } Dynamic Query View: import SwiftData import SwiftUI struct ActiveRegQueryView: View { @Query private var regs: [Registration] @Environment(NavigationViewModel.self) var vm init(searchText: String, sortOrder: sorting) { var order: SortDescriptor<Registration> switch sortOrder { case .byBrand: order = SortDescriptor(\.brand) case .byDateDescending: order = SortDescriptor(\.entryRegistration.entryDate, order: .reverse) case .byDateAscending: order = SortDescriptor(\.entryRegistration.entryDate) } _regs = Query(filter: #Predicate { if !searchText.isEmpty { if $0.activeRegistration && ($0.brand.localizedStandardContains(searchText) || $0.model.localizedStandardContains(searchText) || $0.plate.localizedStandardContains(searchText)) { return true } else { return false } } else { return $0.activeRegistration } }, sort: [order]) } var body: some View { ForEach(regs) { reg in NavigationLink(value: reg) { ListRowView(reg: reg) } // Button { // vm.path.append(reg) // } label: { // ListRowView(reg: reg) // } // .buttonStyle(.plain) } } } I look forward to your ideas for solutions. Thank you for your time.
Posted
by

TestFlight Public Links

Get Started

Pinned Posts

Categories

See all