Post

Replies

Boosts

Views

Activity

Failure to build on some iOS simulators when app includes a call to WKWebView.find method
I have experienced problems with my app crashing on build (I believe it's while linking) with various combinations of Xcode version and iOS simulator version. It dates back to Xcode 16.3 in my testing, and continues through Xcode 16.4 and all Xcode 26 betas. This occurs whether the project running is UIKit-based or SwiftUI-based. Simply dropping a file with the following code into a project, without even needing to refer to its class anywhere else in the project, produces the crash. import Foundation import WebKit class WebBrowserController: NSObject, ObservableObject, WKNavigationDelegate { var webView: WKWebView override init() { self.webView = WKWebView() super.init() } func findString(_ string: String, completion: @escaping (WKFindResult) -> Void) { let configuration = WKFindConfiguration() webView.find(string, configuration: configuration) { result in completion(result) } } } With Xcode 26 beta 4 I am experiencing this issue with iOS 18.4 and iOS 18.5 simulators, but not with iOSW 18.3 or iOS 26 simulators. The complete history of my testing back to Xcode 16.3 and the problematic iOS versions is included Feedback #FB17737471. The crash message appearing in the Xcode 26 beta 4 console for iOS 18.5 is below: dyld[7438]: Library not loaded: /usr/lib/swift/libswiftWebKit.dylib Referenced from: <EF9CE2A7-9F7C-316D-869F-087AECC76C53> /Users/dennisbirch/Library/Developer/CoreSimulator/Devices/CD82152C-E407-4350-B8AE-C15B5304CA05/data/Containers/Bundle/Application/94F80728-CECE-4C24-84CF-C435069B276A/SwiftUIMissingWebViewLib.app/SwiftUIMissingWebViewLib.debug.dylib Reason: tried: '/Users/dennisbirch/Library/Developer/Xcode/DerivedData/SwiftUIMissingWebViewLib-dbhkxwiichsdtygsnxqszkylbivv/Build/Products/Debug-iphonesimulator/libswiftWebKit.dylib' (no such file), '/Library/Developer/CoreSimulator/Volumes/iOS_22F77/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection/libswiftWebKit.dylib' (no such file), '/Library/Developer/CoreSimulator/Volumes/iOS_22F77/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/libswiftWebKit.dylib' (no such file), '/usr/lib/swift/libswiftWebKit.dylib' (no such file, not in dyld cache), '/Library/Developer/CoreSimulator/Volumes/iOS_22F77/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libswiftWebKit.dylib' (no such file) Library not loaded: /usr/lib/swift/libswiftWebKit.dylib Referenced from: <EF9CE2A7-9F7C-316D-869F-087AECC76C53> /Users/dennisbirch/Library/Developer/CoreSimulator/Devices/CD82152C-E407-4350-B8AE-C15B5304CA05/data/Containers/Bundle/Application/94F80728-CECE-4C24-84CF-C435069B276A/SwiftUIMissingWebViewLib.app/SwiftUIMissingWebViewLib.debug.dylib Reason: tried: '/Users/dennisbirch/Library/Developer/Xcode/DerivedData/SwiftUIMissingWebViewLib-dbhkxwiichsdtygsnxqszkylbivv/Build/Products/Debug-iphonesimulator/libswiftWebKit.dylib' (no such file), '/Library/Developer/CoreSimulator/Volumes/iOS_22F77/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection/libswiftWebKit.dylib' (no such file), '/Library/Developer/CoreSimulator/Volumes/iOS_22F77/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/libswiftWebKit.dylib' (no such file), '/usr/lib/swift/libswiftWebKit.dylib' (no such f dyld config: DYLD_SHARED_CACHE_DIR=/Library/Developer/CoreSimulator/Caches/dyld/25A5316i/com.apple.CoreSimulator.SimRuntime.iOS-18-5.22F77/ DYLD_ROOT_PATH=/Library/Developer/CoreSimulator/Volumes/iOS_22F77/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.5.simruntime/Contents/Resources/RuntimeRoot DYLD_LIBRARY_PATH=/Users/dennisbirch/Library/Developer/Xcode/DerivedData/SwiftUIMissingWebViewLib-dbhkxwiichsdtygsnxqszkylbivv/Build/Products/Debug-iphonesimulator:/Library/Developer/CoreSimulator/Volumes/iOS_22F77/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Library/Developer/CoreSimulator/Volumes/iOS_22F77/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libLogRedirect.dylib:/Library/Developer/CoreSimulator/Volumes/iOS_22F77/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libBacktraceRecording.dylib:/Library/Developer/CoreSimulator/Volumes/iOS_22F77/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libMainThreadChecker.dylib:/usr/lib/libRPAC.dylib:/Library/Developer/CoreSimulator/Volumes/iOS_22F77/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libViewDebuggerSupport.dylib DYLD_FRAMEWORK_PATH=/Users/dennisbirch/Library/Developer/Xcode/DerivedData/SwiftUIMissingWebViewLib-dbhkxwiichsdtygsnxqszkylbivv/Build/Products/Debug-iphonesimulator DYLD_FALLBACK_FRAMEWORK_PATH=/Library/Developer/CoreSimulator/Volumes/iOS_22F77/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.5.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks DYLD_FALLBACK_LIBRARY_PATH=/Library/Developer/CoreSimulator/Volumes/iOS_22F77/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 18.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib
0
0
59
1w
URL in scene openURLContexts does not exist
I'm trying to update an old iOS app to use the UIScene architecture, and I've run into a problem I'm hoping somebody can help me fix. When I try to share a file with my app by AirDrop from another device, the URL that I'm getting from the urlContexts argument does not exist on the device. Here's the code I'm using in my SceneDelegate class to get things going: func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) { guard let url = URLContexts.first?.url else { os_log("URL in %@ is nil", #function) return } // check that it's the proper file type guard url.pathExtension == fileExtension.replacingOccurrences(of: ".", with: "") else { return } ... } When I set a breakpoint after populating the url property, checking its existence in the Xcode Console reveals the enclosing folder does not exist: (lldb) po url.path /private/var/mobile/Library/Mobile Documents/com~apple~CloudDocs/Downloads/Seattle Times 2025-04-30 10.dbsud (lldb) po FileManager.default.fileExists(atPath: URL(filePath: "/private/var/mobile/Library/Mobile Documents").path) true (lldb) po FileManager.default.fileExists(atPath: URL(filePath: "/private/var/mobile/Library/Mobile Documents/com-apple-CloudDocs/Downloads").path) false (lldb) po FileManager.default.fileExists(atPath: URL(filePath: "/private/var/mobile/Library/Mobile Documents/com-apple-CloudDocs/").path) false So when I try to process the file at the provided URL, it fails of course. Any ideas on how I can fix this? This is happening while running the code on an iPad with iOS 18.5 from Xcode 16.4. If it makes a difference, the AirDrop is originated from an iPhone 16 Pro also running iOS 18.5.
Topic: UI Frameworks SubTopic: UIKit Tags:
2
0
82
Jul ’25
Exception unarchiving UIToolbar in iOS 18.5 simulator with Xcode 26 beta 2
I'm running into a persistent problem with the iOS 18.5 simulator in Xcode 26 beta 2. I have built a very simple test app with a storyboard that includes only a toolbar added to the ViewController scene in the storyboard. The test app runs fine in iOS 26 simulators.When I try to run it in the iOS 18.5 simulator for iPhone Pro or iPad (16), it fails while unarchiving the storyboard (as far as I can tell) with this error message in the Xcode console: *** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named TtGC5UIKit17UICoreHostingViewVCS_21ToolbarVisualProvider8RootView because no class named TtGC5UIKit17UICoreHostingViewVCS_21ToolbarVisualProvider8RootView was found; the class needs to be defined in source code or linked in from a library (ensure the class is part of the correct target)' terminating due to uncaught exception of type NSException CoreSimulator 1043 - Device: iPad (A16) (3E70E25F-8434-4541-960D-1B58EB4037F3) - Runtime: iOS 18.5 (22F77) - DeviceType: iPad (A16) I'd love a simple workaround for this.
8
2
238
Jul ’25
Creating "type-safe" CIFilter fails
I'm getting consistent errors in Xcode 16.1 while trying to implement type-safe CIFilter instances as documented on the page at https://developer.apple.com/documentation/coreimage/cifilter. After pasting in the example code on that page for a "FalseColor" filter into a simple test project's ContentView, I get an error explaining that: "Type 'CIFilter' has no member 'falseColor'". Same thing with pasting in the example code at https://developer.apple.com/documentation/coreimage/cifilter/3228278-boxblur, and other examples. I have imported CoreImage, so that shouldn't be the issue. Am I doing something wrong, or is this functionality just broken? I have had success creating filters with the string-based API, but access to a type-safe API would obviously be preferable, so any suggestions are greatly appreciated.
2
0
511
Nov ’24
Predictive code completion is not supported in this region
I'm using beta 2 of Xcode 16 on an M1 MacBook with 32 GB of memory, running macOS 15 beta 2. It didn't appear that predictive code completion was working as exhibited in the developer videos, so I tried to figure out what's going on. The Xcode documentation mentions that you can disable predictive code completion in Settings, so I checked there. The checkbox to turn it on is disabled. When I click the "I" button to its right, it tells me that "Predictive code completion is not supported in this region." I am in the US with my system set to US English. What do I have to do to be able to experience this feature?
2
1
2.2k
Jul ’24
Running iOS app from Xcode on Apple Silicon results in LaunchServices error
I am trying to run an iOS project as a Mac app on my M1 Mac Book Pro. It builds fine, but refuses to launch with an error that reads: "The LaunchServices launcher has returned an error. Please check the system logs for the underlying cause of the error." The details of the error start out: "Could not launch “” Domain: IDELaunchErrorDomain Code: 20 Recovery Suggestion: The LaunchServices launcher has returned an error. Please check the system logs for the underlying cause of the error. User Info: { DVTErrorCreationDateKey = "2022-08-03 16:08:24 +0000"; DVTRadarComponentKey = 968756; IDERunOperationFailingWorker = IDELaunchServicesLauncher; } The operation couldn’t be completed. Launch failed. Domain: RBSRequestErrorDomain Code: 5 Failure Reason: Launch failed. Launchd job spawn failed Domain: NSPOSIXErrorDomain Code: 153 " I have gotten this error in both Xcode 13.3.1 and in the last three Xcode 14.0 betas (3, 4 & 5). The project runs fine in the iPhone simulator in all cases. I have tried rebooting the Mac to see if that would clear out bad caches. That didn't help. This is very strange because I successfully ran this iOS project as an Apple Silicon Mac app about a month ago. I even tried resetting the project to remove the few minor changes I made to it back to when it successfully ran as a Mac app. Anybody know what's going on here and how to fix it?
1
1
1.1k
Aug ’22
API for camera magnification level?
Is there a programmatic means of getting an iPhone camera lens' magnification level? I'm referring to the .5x, 1x and 2.x/2.5x/3.x values for the ultra wide, wide and telephoto lenses available on iPhones of the last few years. I tried accessing the AVCaptureDevice videoZoomFactor property, but that returns the same value for both of my iPhone's cameras.
0
0
637
Sep ’21
Running Xcode 13 beta project in Xcode 12 results in "letterboxed" appearance
I have been able to reproduce a problem with running a SwiftUI iOS app project converted in Xcode 13 beta for use in Xcode 12. Doing so is consistently resulting in the main view's top and bottom being cut off and centered within a black background (I believe this is referred to as "letterboxing"). Here are the steps to follow: Use xcode-select to set your environment for the Xcode 13 beta and launch it. Create a new SwiftUI app In its ContentView file, add some content Run the project in the iOS Simulator Select the project in the Project navigator and in the File Inspector, change the Project Format dropdown menu to Xcode 11.4-compatible or Xcode 12-compatible. Quit the Xcode beta and the Simulator. Use xcode-select to set your environment for Xcode 12.5 and launch it. Open the project you created in Xcode 13 beta and run it in the iOS Simulator. Your simulator screen should look something like the screenshot below. I have not been able to find any way of fixing this problem once the file has been opened in Xcode 12. After relaunching Xcode 13 and rerunning it there the black borders do not appear (but there are other problems I've run into that make me want to continue development in Xcode 12 for the project where I ran into this problem.)
0
0
1.5k
Jun ’21
Combine in AppKit - issue with publisher(for: NSControl.textDidChangeNotification...
I'm trying to learn how to use Combine in an AppKit app I'm working on. I found an Apple Developer article that explains pretty much exactly what I'm trying to achieve, delaying input from an NSTextField with the .debounce operator. (https://developer.apple.com/documentation/combine/receiving-and-handling-events-with-combine) Unfortunately it doesn't seem to be working for me. I have created a function in a NSTableCellView subclass that gets called as part of the cell's configuration which looks like:     private func watchForSearchTextEntries() { print("Setting up search text observer") let sub = NotificationCenter.default .publisher(for: NSControl.textDidChangeNotification, object: searchTermText) .map( { ($0.object as! NSTextField).stringValue } ) .sink(receiveCompletion: { print ($0) }, receiveValue: { print ($0) })  } When I run the app and type in that field, nothing gets printed to the Console. As a test, I also tried adding a NotificationCenter observer that calls a method to print out the notification's object. NotificationCenter.default.addObserver(self, selector: #selector(receivedTextChangeNotification(_:)), name: NSControl.textDidChangeNotification, object: searchTermText) That works as expected. So what's going on with my attempted use of Combine?
1
0
1.2k
Apr ’21