Our app encountered a new crash since beta5(23A5308g) released last week,and it seems the crash is not solved yet in beta6(23A5318c).The crash stack below
`-[UIView _backing_setPosition:]
-[UIView setCenter:]
-[_UIEditMenuContentPresentation _displayPreparedMenu:titleView:reason:didDismissMenu:configuration:]
___54-[_UIEditMenuContentPresentation _displayMenu:reason:]_block_invoke
-[UIEditMenuInteraction _editMenuPresentation:preparedMenuForDisplay:completion:]
-[_UIEditMenuContentPresentation _displayMenu:reason:]
-[_UIEditMenuContentPresentation displayMenu:configuration:]
___58-[UIEditMenuInteraction presentEditMenuWithConfiguration:]_block_invoke
___80-[UIEditMenuInteraction _prepareMenuAtLocation:configuration:completionHandler:]_block_invoke
___109-[UITextContextMenuInteraction _editMenuInteraction:menuForConfiguration:suggestedActions:completionHandler:]_block_invoke
___107-[UITextContextMenuInteraction _querySelectionCommandsForConfiguration:suggestedActions:completionHandler:]_block_invoke
WTF::CompletionHandler<void (WebKit::DocumentEditingContext&&)>::operator()(WebKit::DocumentEditingContext&&)
WTF::Detail::CallableWrapper<IPC::Connection::makeAsyncReplyCompletionHandler<Messages::WebPage::RequestDocumentEditingContext, WTF::CompletionHandler<void (WebKit::DocumentEditingContext&&)> >(WTF::CompletionHandler<void (WebKit::DocumentEditingContext&&)>&&, WTF::ThreadLikeAssertion)::{lambda(IPC::Connection*, IPC::Decoder*)#1}, void, IPC::Connection*, IPC::Decoder*>::call(IPC::Connection*, IPC::Decoder*)
WTF::Detail::CallableWrapper<WebKit::AuxiliaryProcessProxy::sendMessage(WTF::UniqueRefIPC::Encoder&&, WTF::OptionSetIPC::SendOption, std::__1::optionalIPC::ConnectionAsyncReplyHandler, WebKit::AuxiliaryProcessProxy::ShouldStartProcessThrottlerActivity)::$_1, void, IPC::Connection*, IPC::Decoder*>::call(IPC::Connection*, IPC::Decoder*)
IPC::Connection::dispatchMessage(WTF::UniqueRefIPC::Decoder)
IPC::Connection::dispatchIncomingMessages()
WTF::RunLoop::performWork()
WTF::RunLoop::performWork(void*)
_CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION
___CFRunLoopDoSource0
___CFRunLoopDoSources0
___CFRunLoopRun
__CFRunLoopRunSpecificWithOptions
_GSEventRunModal
-[UIApplication _run]
_UIApplicationMain
main main.m
start
WebKit
RSS for tagDisplay web content in windows and implement browser features using WebKit.
Posts under WebKit tag
200 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
I’m experiencing a crash in WKWebView on iOS 26 Developer Beta 5 and Beta 6 with the following exception:
CALayer position contains NaN: [nan 65]
The crash occurs when the following CSS properties are applied to content displayed in WKWebView:
-webkit-user-select: none;
-webkit-touch-callout: none;
This issue happens consistently whenever these styles are set, leading to the crash inside WKWebView.
Is this a known bug in the current iOS 26 betas, or is there a recommended workaround?
I'm developing a cross-platform application using Tauri, which uses WebView technology as the GUI renderer. On macOS, it should be using WKWebView. Based on my tests, all applications developed with Tauri can only run at 60fps on macOS and cannot take advantage of ProMotion displays to achieve a 120fps refresh rate, whereas the same application can run at 120fps on other platforms. I have submitted this issue to Tauri on GitHub, and it appears that this cannot be resolved through external settings, but only by modifying the WKWebView code to support higher frame rates. Is there any possible solution to this?
Environment
• Device: iOS 26 Developer Beta 5 (23A5308g)
• Xcode: 16.3
Short description
The app crashes the moment the user tries to long-press to select text inside a WKWebView, double-tap an image with Text (magnifier appears)
The exception is CALayer position contains NaN. frame = (nan,0;0,48) chorPoint=(inf, 0) and it is thrown in the UI process.
Build & run any project that hosts a WKWebView. Inject the following CSS via script (this is what we do to suppress the native callout menu):
WKWebView *webView = [[WKWebView alloc] initWithFrame:self.view.bounds
configuration:[WKWebViewConfiguration new]];
NSString *js =
@"document.documentElement.style.webkitUserSelect='none';"
"document.documentElement.style.webkitTouchCallout='none';";
[webView evaluateJavaScript:js completionHandler:nil];
[self.view addSubview:webView];
Incident Identifier: EE6FB046-5087-4F15-A72D-A74965347A30
CrashReporter Key: 29e8e58e02a07557adb4ce3f463d764f3ce8bbd5
Hardware Model: iPhone16,1
Process: wallet [642]
Path: /private/var/containers/Bundle/Application/4B4E609A-C8BF-4C56-AB2A-1638249B98A5/wallet.app/wallet
Identifier: xxxx
Version: xxxx
AppStoreTools: 16F7
AppVariant: 1:iPhone16,1:18
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: xxxxx
Date/Time: 2025-08-06 12:05:24.0732 +0800
Launch Time: 2025-08-06 11:49:40.3802 +0800
OS Version: iPhone OS 26.0 (23A5308g)
Release Type: Beta
Baseband Version: 3.02.02
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Termination Reason: SIGNAL 6 Abort trap: 6
Terminating Process: wallet [642]
Triggered by Thread: 0
Application Specific Information:
abort() called
Last Exception Backtrace:
0 CoreFoundation 0x185e058c8 __exceptionPreprocess + 164
1 libobjc.A.dylib 0x182d797c4 objc_exception_throw + 88
2 CoreFoundation 0x185e908d4 -[NSException initWithCoder:] + 0
3 QuartzCore 0x18678a874 CA::Layer::set_position(CA::Vec2<double> const&, bool) + 160
4 QuartzCore 0x1869a7270 -[CALayer setPosition:] + 52
5 UIKitCore 0x18c4ac564 -[UIView _backing_setPosition:] + 176
6 UIKitCore 0x18cefdf0c -[UIView setCenter:] + 220
7 UIKitCore 0x18cd9f794 -[_UIEditMenuContentPresentation _displayPreparedMenu:titleView:reason:didDismissMenu:configuration:] + 936
8 UIKitCore 0x18cd9f3c0 __54-[_UIEditMenuContentPresentation _displayMenu:reason:]_block_invoke + 104
9 UIKitCore 0x18ced1060 -[UIEditMenuInteraction _editMenuPresentation:preparedMenuForDisplay:completion:] + 384
10 UIKitCore 0x18cd9f2e4 -[_UIEditMenuContentPresentation _displayMenu:reason:] + 304
11 UIKitCore 0x18cd9f0d8 -[_UIEditMenuContentPresentation displayMenu:configuration:] + 64
12 UIKitCore 0x18ced0344 __58-[UIEditMenuInteraction presentEditMenuWithConfiguration:]_block_invoke + 260
13 UIKitCore 0x18ced1f8c __80-[UIEditMenuInteraction _prepareMenuAtLocation:configuration:completionHandler:]_block_invoke + 80
14 UIKitCore 0x18cc8403c __109-[UITextContextMenuInteraction _editMenuInteraction:menuForConfiguration:suggestedActions:completionHandler:]_block_invoke + 180
15 UIKitCore 0x18cc84584 __107-[UITextContextMenuInteraction _querySelectionCommandsForConfiguration:suggestedActions:completionHandler:]_block_invoke + 148
16 WebKit 0x1a05ae5d4 WTF::CompletionHandler<void (WebKit::DocumentEditingContext&&)>::operator()(WebKit::DocumentEditingContext&&) + 64
17 WebKit 0x1a05bb468 WTF::Detail::CallableWrapper<WTF::CompletionHandler<void (IPC::Connection*, IPC::Decoder*)> IPC::Connection::makeAsyncReplyCompletionHandler<Messages::WebPage::RequestDocumentEditingContext, WTF::CompletionHandler<void (WebKit::DocumentEditingContext&&)>>(WTF::CompletionHandler<void (WebKit::DocumentEditingContext&&)>&&, WTF::ThreadLikeAssertion)::'lambda'(IPC::Connection*, IPC::Decoder*), void, IPC::Connection*, IPC::Decoder*>::call(IPC::Connection*, IPC::Decoder*) + 196
18 WebKit 0x19fcf5db8 WTF::Detail::CallableWrapper<WebKit::AuxiliaryProcessProxy::sendMessage(WTF::UniqueRef<IPC::Encoder>&&, WTF::OptionSet<IPC::SendOption>, std::__1::optional<IPC::ConnectionAsyncReplyHandler>, WebKit::AuxiliaryProcessProxy::ShouldStartProcessThrottlerActivity)::$_1, void, IPC::Connection*, IPC::Decoder*>::call(IPC::Connection*, IPC::Decoder*) + 64
19 WebKit 0x19fce54f0 IPC::Connection::dispatchMessage(WTF::UniqueRef<IPC::Decoder>) + 340
20 WebKit 0x19fcf5aa0 IPC::Connection::dispatchIncomingMessages() + 536
21 JavaScriptCore 0x19a8f85d4 WTF::RunLoop::performWork() + 552
22 JavaScriptCore 0x19a8f838c WTF::RunLoop::performWork(void*) + 36
23 CoreFoundation 0x185da6230 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
24 CoreFoundation 0x185da61a4 __CFRunLoopDoSource0 + 172
25 CoreFoundation 0x185d83c6c __CFRunLoopDoSources0 + 232
26 CoreFoundation 0x185d598b0 __CFRunLoopRun + 820
27 CoreFoundation 0x185d58c44 _CFRunLoopRunSpecificWithOptions + 532
28 GraphicsServices 0x224ce0498 GSEventRunModal + 120
29 UIKitCore 0x18b6c84b8 -[UIApplication _run] + 792
30 UIKitCore 0x18b66cbc0 UIApplicationMain + 336
31 wallet 0x1046f8558 0x1046f4000 + 17752
32 dyld 0x182dcdb18 start + 6332
Environment
• Device: any iPhone running iOS 26 Developer Beta 5 (23A5308g)
• Xcode: 16.3
Short description
The app crashes the moment the user tries to long-press to select text inside a WKWebView, double-tap an image with Text (magnifier appears)
The exception is CALayer position contains NaN. frame = (nan,0;0,48) chorPoint=(inf, 0) and it is thrown in the UI process.
Build & run any project that hosts a WKWebView. Inject the following CSS via script (this is what we do to suppress the native callout menu):
WKWebView *webView = [[WKWebView alloc] initWithFrame:self.view.bounds
configuration:[WKWebViewConfiguration new]];
NSString *js =
@"document.documentElement.style.webkitUserSelect='none';"
"document.documentElement.style.webkitTouchCallout='none';";
[webView evaluateJavaScript:js completionHandler:nil];
[self.view addSubview:webView];
Incident Identifier: EE6FB046-5087-4F15-A72D-A74965347A30
CrashReporter Key: 29e8e58e02a07557adb4ce3f463d764f3ce8bbd5
Hardware Model: iPhone16,1
Process: wallet [642]
Path: /private/var/containers/Bundle/Application/4B4E609A-C8BF-4C56-AB2A-1638249B98A5/wallet.app/wallet
Identifier: xxxxxxx
Version: xxxx
AppStoreTools: 16F7
AppVariant: 1:iPhone16,1:18
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: xxxxxx
Date/Time: 2025-08-06 12:05:24.0732 +0800
Launch Time: 2025-08-06 11:49:40.3802 +0800
OS Version: iPhone OS 26.0 (23A5308g)
Release Type: Beta
Baseband Version: 3.02.02
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Termination Reason: SIGNAL 6 Abort trap: 6
Terminating Process: wallet [642]
Triggered by Thread: 0
Application Specific Information:
abort() called
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x22da0f0cc __pthread_kill + 8
1 libsystem_pthread.dylib 0x1e097b7e8 pthread_kill + 268
2 libsystem_c.dylib 0x191361f1c abort + 124
3 libc++abi.dylib 0x182e7a808 __abort_message + 132
4 libc++abi.dylib 0x182e69484 demangling_terminate_handler() + 304
5 libobjc.A.dylib 0x182d7bf28 _objc_terminate() + 156
6 wallet 0x1068ff8c8 0x1046f4000 + 35698888
7 libc++abi.dylib 0x182e79bdc std::__terminate(void (*)()) + 16
8 libc++abi.dylib 0x182e7d314 __cxxabiv1::failed_throw(__cxxabiv1::__cxa_exception*) + 88
9 libc++abi.dylib 0x182e7d2bc __cxa_throw + 92
10 libobjc.A.dylib 0x182d7992c objc_exception_throw + 448
11 CoreFoundation 0x185e908d4 +[NSException raise:format:] + 128
12 QuartzCore 0x18678a874 CA::Layer::set_position(CA::Vec2<double> const&, bool) + 160
13 QuartzCore 0x1869a7270 -[CALayer setPosition:] + 52
14 UIKitCore 0x18c4ac564 -[UIView _backing_setPosition:] + 176
15 UIKitCore 0x18cefdf0c -[UIView setCenter:] + 220
16 UIKitCore 0x18cd9f794 -[_UIEditMenuContentPresentation _displayPreparedMenu:titleView:reason:didDismissMenu:configuration:] + 936
17 UIKitCore 0x18cd9f3c0 __54-[_UIEditMenuContentPresentation _displayMenu:reason:]_block_invoke + 104
18 UIKitCore 0x18ced1060 -[UIEditMenuInteraction _editMenuPresentation:preparedMenuForDisplay:completion:] + 384
19 UIKitCore 0x18cd9f2e4 -[_UIEditMenuContentPresentation _displayMenu:reason:] + 304
20 UIKitCore 0x18cd9f0d8 -[_UIEditMenuContentPresentation displayMenu:configuration:] + 64
21 UIKitCore 0x18ced0344 __58-[UIEditMenuInteraction presentEditMenuWithConfiguration:]_block_invoke + 260
22 UIKitCore 0x18ced1f8c __80-[UIEditMenuInteraction _prepareMenuAtLocation:configuration:completionHandler:]_block_invoke + 80
23 UIKitCore 0x18cc8403c __109-[UITextContextMenuInteraction _editMenuInteraction:menuForConfiguration:suggestedActions:completionHandler:]_block_invoke + 180
24 UIKitCore 0x18cc84584 __107-[UITextContextMenuInteraction _querySelectionCommandsForConfiguration:suggestedActions:completionHandler:]_block_invoke + 148
25 WebKit 0x1a05ae5d4 WTF::CompletionHandler<void (WebKit::DocumentEditingContext&&)>::operator()(WebKit::DocumentEditingContext&&) + 64
26 WebKit 0x1a05bb468 WTF::Detail::CallableWrapper<WTF::CompletionHandler<void (IPC::Connection*, IPC::Decoder*)> IPC::Connection::makeAsyncReplyCompletionHandler<Messages::WebPage::RequestDocumentEditingContext, WTF::CompletionHandler<void (WebKit::DocumentEditingContext&&)>>(WTF::CompletionHandler<void (WebKit::DocumentEditingContext&&)>&&, WTF::ThreadLikeAssertion)::'lambda'(IPC::Connection*, IPC::Decoder*), void, IPC::Connection*, IPC::Decoder*>::call(IPC::Connection*, IPC::Decoder*) + 196
27 WebKit 0x19fcf5db8 WTF::Detail::CallableWrapper<WebKit::AuxiliaryProcessProxy::sendMessage(WTF::UniqueRef<IPC::Encoder>&&, WTF::OptionSet<IPC::SendOption>, std::__1::optional<IPC::ConnectionAsyncReplyHandler>, WebKit::AuxiliaryProcessProxy::ShouldStartProcessThrottlerActivity)::$_1, void, IPC::Connection*, IPC::Decoder*>::call(IPC::Connection*, IPC::Decoder*) + 64
28 WebKit 0x19fce54f0 IPC::Connection::dispatchMessage(WTF::UniqueRef<IPC::Decoder>) + 340
29 WebKit 0x19fcf5aa0 IPC::Connection::dispatchIncomingMessages() + 536
30 JavaScriptCore 0x19a8f85d4 WTF::RunLoop::performWork() + 552
31 JavaScriptCore 0x19a8f838c WTF::RunLoop::performWork(void*) + 36
32 CoreFoundation 0x185da6230 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
33 CoreFoundation 0x185da61a4 __CFRunLoopDoSource0 + 172
34 CoreFoundation 0x185d83c6c __CFRunLoopDoSources0 + 232
35 CoreFoundation 0x185d598b0 __CFRunLoopRun + 820
36 CoreFoundation 0x185d58c44 _CFRunLoopRunSpecificWithOptions + 532
37 GraphicsServices 0x224ce0498 GSEventRunModal + 120
38 UIKitCore 0x18b6c84b8 -[UIApplication _run] + 792
39 UIKitCore 0x18b66cbc0 UIApplicationMain + 336
40 wallet 0x1046f8558 0x1046f4000 + 17752
41 dyld 0x182dcdb18 start + 6332
WKWebView has set the option to disable selection ("document. documentElement. style. webkitUserSelect='none ';") and long press ("document. documentElement. style. webkitTouchCallout='none';"). If there is text on one of the images in WebView, simply tap the image twice and then long press the text. The program will crash with the following error message:
0 CoreFoundation 0x185e058c8 __exceptionPreprocess + 164
1 libobjc.A.dylib 0x182d797c4 objc_exception_throw + 88
2 CoreFoundation 0x185e908d4 -[NSException initWithCoder:] + 0
3 QuartzCore 0x18678a874 CA::Layer::set_position(CA::Vec2<double> const&, bool) + 160
4 QuartzCore 0x1869a7270 -[CALayer setPosition:] + 52
5 UIKitCore 0x18c4ac564 -[UIView _backing_setPosition:] + 176
6 UIKitCore 0x18cefdf0c -[UIView setCenter:] + 220
7 UIKitCore 0x18cd9f794 -[_UIEditMenuContentPresentation _displayPreparedMenu:titleView:reason:didDismissMenu:configuration:] + 936
8 UIKitCore 0x18cd9f3c0 __54-[_UIEditMenuContentPresentation _displayMenu:reason:]_block_invoke + 104
9 UIKitCore 0x18ced1060 -[UIEditMenuInteraction _editMenuPresentation:preparedMenuForDisplay:completion:] + 384
10 UIKitCore 0x18cd9f2e4 -[_UIEditMenuContentPresentation _displayMenu:reason:] + 304
11 UIKitCore 0x18cd9f0d8 -[_UIEditMenuContentPresentation displayMenu:configuration:] + 64
12 UIKitCore 0x18ced0344 __58-[UIEditMenuInteraction presentEditMenuWithConfiguration:]_block_invoke + 260
13 UIKitCore 0x18ced1f8c __80-[UIEditMenuInteraction _prepareMenuAtLocation:configuration:completionHandler:]_block_invoke + 80
14 UIKitCore 0x18cc8403c __109-[UITextContextMenuInteraction _editMenuInteraction:menuForConfiguration:suggestedActions:completionHandler:]_block_invoke + 180
15 UIKitCore 0x18cc84584 __107-[UITextContextMenuInteraction _querySelectionCommandsForConfiguration:suggestedActions:completionHandler:]_block_invoke + 148
16 WebKit 0x1a05ae5d4 WTF::CompletionHandler<void (WebKit::DocumentEditingContext&&)>::operator()(WebKit::DocumentEditingContext&&) + 64
17 WebKit 0x1a05bb468 WTF::Detail::CallableWrapper<WTF::CompletionHandler<void (IPC::Connection*, IPC::Decoder*)> IPC::Connection::makeAsyncReplyCompletionHandler<Messages::WebPage::RequestDocumentEditingContext, WTF::CompletionHandler<void (WebKit::DocumentEditingContext&&)>>(WTF::CompletionHandler<void (WebKit::DocumentEditingContext&&)>&&, WTF::ThreadLikeAssertion)::'lambda'(IPC::Connection*, IPC::Decoder*), void, IPC::Connection*, IPC::Decoder*>::call(IPC::Connection*, IPC::Decoder*) + 196
18 WebKit 0x19fcf5db8 WTF::Detail::CallableWrapper<WebKit::AuxiliaryProcessProxy::sendMessage(WTF::UniqueRef<IPC::Encoder>&&, WTF::OptionSet<IPC::SendOption>, std::__1::optional<IPC::ConnectionAsyncReplyHandler>, WebKit::AuxiliaryProcessProxy::ShouldStartProcessThrottlerActivity)::$_1, void, IPC::Connection*, IPC::Decoder*>::call(IPC::Connection*, IPC::Decoder*) + 64
19 WebKit 0x19fce54f0 IPC::Connection::dispatchMessage(WTF::UniqueRef<IPC::Decoder>) + 340
20 WebKit 0x19fcf5aa0 IPC::Connection::dispatchIncomingMessages() + 536
Will the official version have this issue?
In iOS 26 beta 3, it was possible to have a UIScrollEdgeElementContainerInteraction work with a WKWebView's scroll view. But it stopped working in beta 4, and is still broken in beta 5 today. Is this expected? Or is this a bug that will be fixed before public release?
Filed as FB19386650 with a trivial sample app.
How can I make a background image take the entire screen in ios26?
I've tried position fixed, sticky, env() css variables but nothing worked. It does it when in PWA mode, but I would like to do so in the browser too.
hello,
My organization has an outlook add-in that requires auth into our platform. As Microsoft forces Auth on MacOS to use WKWebView https://learn.microsoft.com/en-us/office/dev/add-ins/concepts/browsers-used-by-office-web-add-ins, we are running into a situation that we cannot use passkeys as an auth method as we are unable to trigger WebAuthN flows.
We’ve raised this in Microsoft side but they have deferred to Apple given WKWebView is Safari based.
This is a big blocker for us to achieve a full passwordless future. Has anyone come across this situation?
Thank you.
Topic:
Privacy & Security
SubTopic:
General
Tags:
Passkeys in iCloud Keychain
Authentication Services
WebKit
I'm building a visionOS app where users can place canvases into the 3D environment. These canvases are RealityKit entities that render web content using a WKWebView. The web view is regularly snapshotted, and its image is applied as a texture on the canvas surface.
When the user taps on a canvas, a WindowGroup is opened that displays the same shared WKWebView instance. This works great: both the canvas in 3D and the WindowGroup reflect the same live web content.
The canvas owns the WKWebView and keeps a strong reference to it.
Problem:
Once the user closes the WindowGroup, the 3D canvas stops receiving snapshot updates. The snapshot loop task is still running (verified via logs), but WKWebView.takeSnapshot(...) never returns — the continuation hangs forever. No error is thrown, no image is returned.
If the user taps the canvas again (reopening the window), snapshots resume and everything works again.
@MainActor
private func getSnapshot() async -> UIImage? {
guard !webView.isLoading else { return nil }
let config = WKSnapshotConfiguration()
config.rect = webView.bounds
config.afterScreenUpdates = true
return await withCheckedContinuation { continuation in
webView.takeSnapshot(with: config) { image, _ in
continuation.resume(returning: image)
}
}
}
What I’ve already verified:
The WKWebView is still in memory.
The snapshot loop (Task) is still running; it just gets stuck inside takeSnapshot(...).
I tried keeping the WKWebView inside a hidden UIWindow (with .alpha = 0.01, .windowLevel = .alert + 1, and isHidden = false).
Suspicion
It seems that once a WKWebView is passed into SwiftUI and rendered (e.g., via UIViewRepresentable), SwiftUI takes full control over its lifecycle. SwiftUI tells WebKit "This view got closed" and WebKit reacts by stopping the WKWebView. Even though it still exists in memory and is being hold by a strong reference to it in the Canvas-Entity.
Right now, this feels like a one-way path:
Starting from the canvas, tapping it to open the WindowGroup works fine.
But once the WindowGroup is closed, the WebView freezes, and snapshots stop until the view is reopened.
Questions
Is there any way under visionOS to:
Keep a WKWebView rendering after its SwiftUI view (WindowGroup) is dismissed?
Prevent WebKit from suspending or freezing the view?
Embed the view in a persistent system-rendered context to keep snapshotting functional?
For context, here's the relevant SwiftUI setup
struct MyWebView: View {
var body: some View {
if let webView = WebViewManager.shared.getWebView() {
WebViewContainer(webView: webView)
}
}
}
struct WebViewContainer: UIViewRepresentable {
let webView: WKWebView
func makeUIView(context: Context) -> UIView {
return webView
}
func updateUIView(_ uiView: UIView, context: Context) {}
}
Hi everyone,
I’m currently working on a UITableView setup that uses UITableViewDiffableDataSource. Each cell contains two views:
A UILabel for a title
A WKWebView that loads dynamic HTML content
My Current Approach:
On initial load, I let all cells render with default height.
As each WKWebView finishes loading, I calculate its content height using JavaScript and store this height in a [String: CGFloat] dictionary keyed by a unique identifier for each WebView.
I then call tableView.performBatchUpdates to trigger a layout update and resize the cell.
When the same cell index and data are shown again, I retrieve the cached height from the dictionary and apply it as a constraint on the WKWebView before loading its content.
This mostly works, but occasionally, there are visual glitches — such as flickering during scrolling or incorrect cell heights temporarily shown before the height is re-applied.
My Questions:
Is this a recommended or sustainable way for handling WKWebView inside a UITableViewCell, especially with DiffableDataSource?
Are there any known best practices or alternatives to manage dynamic web content heights more smoothly in table cells?
Is it possible that the glitches are caused by layout timing issues or reentrancy of height calculation and rendering?
Any suggestions, refinements, or architectural recommendations would be greatly appreciated.
Thanks in advance!
Something has changed in iOS 26 and now if custom scheme is used and web page contains scripts WebKit is terminated.
0x1130bc170 - [PID=47858] WebProcessProxy::didClose: (web process 0 crash)
0x1130bc170 - [PID=47858] WebProcessProxy::processDidTerminateOrFailedToLaunch: reason=Crash
final class CustomSchemeViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let sampleConfiguration = WKWebViewConfiguration()
sampleConfiguration.setURLSchemeHandler(
SampleURLSchemeHandler(),
forURLScheme: "sample"
)
let webView = WKWebView(frame: view.bounds, configuration: sampleConfiguration)
webView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
view.addSubview(webView)
webView.navigationDelegate = self
webView.load(URLRequest(url: URL(string: "sample://pages/sample.html")!))
}
}
extension CustomSchemeViewController: WKNavigationDelegate {
func webViewWebContentProcessDidTerminate(_ webView: WKWebView) {
print("webViewWebContentProcessDidTerminate")
}
}
final class SampleURLSchemeHandler: NSObject, WKURLSchemeHandler {
private func post(_ body: String, mimeType: String, urlSchemeTask: WKURLSchemeTask) {
let body = Data(body.utf8)
let response = URLResponse(
url: urlSchemeTask.request.url!,
mimeType: mimeType,
expectedContentLength: body.count,
textEncodingName: nil
)
urlSchemeTask.didReceive(response)
urlSchemeTask.didReceive(body)
urlSchemeTask.didFinish()
}
func webView(_ webView: WKWebView, start urlSchemeTask: WKURLSchemeTask) {
switch urlSchemeTask.request.url?.lastPathComponent {
case "sample.html":
post("""
<?xml version="1.0" encoding="UTF-8"?><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="/scripts/sample.js"></script>
</head>
<body>
<p>Sample</p>
</body>
</html>
""",
mimeType: "application/xhtml+xml",
urlSchemeTask: urlSchemeTask
)
case "sample.js":
post("console.log('Hello from JS File')",
mimeType: "text/javascript",
urlSchemeTask: urlSchemeTask
)
default:
assertionFailure()
}
}
func webView(_ webView: WKWebView, stop urlSchemeTask: WKURLSchemeTask) {
print("webView(_ webView: WKWebView, stop urlSchemeTask: WKURLSchemeTask)")
}
}
It works fine with css file inside, without script tag or with async attribute
Code of sample project https://github.com/Igor-Palaguta/iOS26URLSchemeTermination
We are building a hybrid iOS app using Angular (web) rendered inside a WKWebView, hosted by a native Swift app. Communication between the Angular UI and native Swift code is done using WKScriptMessageHandler.
The app mostly works without issues, but in rare edge cases, we’re seeing crashes on the main thread, and the crash is reported in Firebase Crashlytics. The root cause appears related to CFRelease and WKScriptMessageHandler.
Here’s the relevant crash stack:
Crashed: com.apple.main-thread
0 CoreFoundation 0xbfac CFRelease + 44
1 CoreFoundation 0xa734 __CFURLDeallocate + 128
2 CoreFoundation 0x730c _CFRelease + 292
3 libobjc.A.dylib 0x4e28 AutoreleasePoolPage::releaseUntil(objc_object**) + 204
4 libobjc.A.dylib 0x4cbc objc_autoreleasePoolPop + 260
5 WebKit 0x99f194 WebKit::WebUserContentControllerProxy::didPostMessage(WTF::ObjectIdentifierGeneric<WebKit::WebPageProxyIdentifierType, WTF::ObjectIdentifierMainThreadAccessTraits<unsigned long long>, unsigned long long>, WebKit::FrameInfoData&&, WTF::ObjectIdentifierGeneric<WebKit::ScriptMessageHandlerIdentifierType, WTF::ObjectIdentifierMainThreadAccessTraits<unsigned long long>, unsigned long long>, std::__1::span<unsigned char const, 18446744073709551615ul>, WTF::CompletionHandler<void (std::__1::span<unsigned char const, 18446744073709551615ul>, WTF::String const&)>&&) + 680
6 WebKit 0x1b358 WebKit::WebUserContentControllerProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&) + 392
7 WebKit 0xe86b0 IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&, IPC::Decoder&) + 272
8 WebKit 0x23c0c WebKit::WebProcessProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&) + 44
9 WebKit 0xe3f054 IPC::Connection::dispatchMessage(WTF::UniqueRef<IPC::Decoder>) + 252
10 WebKit 0x332d4 IPC::Connection::dispatchIncomingMessages() + 744
11 JavaScriptCore 0x58a7c WTF::RunLoop::performWork() + 204
12 JavaScriptCore 0x599a4 WTF::RunLoop::performWork(void*) + 36
13 CoreFoundation 0x56328 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
14 CoreFoundation 0x562bc __CFRunLoopDoSource0 + 176
15 CoreFoundation 0x53dc0 __CFRunLoopDoSources0 + 244
16 CoreFoundation 0x52fbc __CFRunLoopRun + 840
17 CoreFoundation 0x52830 CFRunLoopRunSpecific + 588
18 GraphicsServices 0x11c4 GSEventRunModal + 164
19 UIKitCore 0x3d2eb0 -[UIApplication _run] + 816
20 UIKitCore 0x4815b4 UIApplicationMain + 340
21 APP1 0xa2f80 main + 21 (AppDelegate.swift:21)
22 ??? 0x1c234eec8 (シンボルが不足しています)
Steps:
WebView: WKWebView
Message passing: WKScriptMessageHandler → passing data from Angular → Swift
WKWebView is long-lived and reused
Native is using WKUserContentController.add(_:name:) to register handlers
Crashes are intermittent (hard to reproduce), but often follow:
Screen sleep/wake
Push notification open
Angular calling native immediately after resume
Questions:
Has anyone seen this specific crash pattern involving CFRelease and WKScriptMessageHandler?
Are there known WebKit or CoreFoundation bugs related to WKScriptMessageHandler and retained URLs or message content?
Thank you for your help!
Our app connects to the headend to get a IDP login URL for each connection session, for example: “https://myvpn.ocwa.com/+CSCOE+/saml/sp/login?ctx=3627097090&acsamlcap=v2” and then open embedded webview to load the page. (Note: the value of ctx is session token which changes every time). Quite often the webview shows blank white screen. After user cancel the connection and re-connect, the 2nd time webview loads the content successfully.
The working case logs shows:
didReceiveAuthenticationChallenge is called
decidePolicyForNavigationAction is called twice
didReceiveAuthenticationChallenge is called
decidePolicyForNavigationResponse is called
didReceiveAuthenticationChallenge is called
But the failure case shows:
Filed to terminate process: Error Domain=com.apple.extensionKit.errorDomain Code=18 "(null)" UserInfo={NSUnderlyingError=0x11461c240 {Error Domain=RBSRequestErrorDomain Code=3 "No such process found" UserInfo={NSLocalizedFailureReason=No such process found}}}
didReceiveAuthenticationChallenge is called
decidePolicyForNavigationAction is called
decidePolicyForNavigationResponse is called
If we stop calling evaluateJavaScript code to get userAgent, the blank page happens less frequently. Below is the code we put in makeUIView():
func makeUIView(context: Context) -> WKWebView
{
if let url = URL(string: self.myUrl)
{
let request = URLRequest(url: url)
webview.evaluateJavaScript("navigator.userAgent")
{
result, error in
if let error = error
{
NSLog("evaluateJavaScript Error: \(error)")
}
else
{
let agent = result as! String + " " + self.myUserAgent
webview.customUserAgent = agent
webview.load(request)
}
}
}
return self.webview
}
Found some posts saying call evaluateJavaScript only after WKWebView has finished loading its content. However, it will block us to send the userAgent info via HTTP request. And I don’t think it is the root cause since the problem still occurs with less frequency.
There is no problem to load same web page on Windows desktop and Android devices. The problem only occurs on iOS and macOS which both use WKWebview APIs.
Is there a bug in WKWebview?
Thanks,
Ying
When we embed some of the youtube videos are unable to load in the Mobile app but at the same time it works in Website. I need to allow it in both places.
I have tried both embed and native sdk for youtube in iOS.
Hello.
I have a project that loads a page using jquery 3.6.3 in WKWebView.
When I try this on iOS developer beta 4, WKWebView malfunctions and the page does not load properly.
If I remove jquery, the page loads.
Even if I update jquery to the latest version, the problem remains the same.
This problem did not occur until developer beta 3.
The log is as follows.
0x12107c170 - [PID=994] WebProcessProxy::didClose: (web process 0 crash)
0x12107c170 - [PID=994] WebProcessProxy::processDidTerminateOrFailedToLaunch: reason=Crash
Error acquiring assertion: <Error Domain=RBSAssertionErrorDomain Code=2 "Specified target process 994 does not exist" UserInfo={NSLocalizedFailureReason=Specified target process 994 does not exist}>
0x121138300 - ProcessAssertion::acquireSync Failed to acquire RBS assertion 'XPCConnectionTerminationWatchdog' for process with PID=994, error: (null)
0x132e00018 - [pageProxyID=9, webPageID=10, PID=994] WebPageProxy::processDidTerminate: (pid 994), reason=Crash
0x132e00018 - [pageProxyID=9, webPageID=10, PID=994] WebPageProxy::dispatchProcessDidTerminate: reason=Crash
Failed to terminate process: Error Domain=com.apple.extensionKit.errorDomain Code=18 "(null)" UserInfo={NSUnderlyingError=0x13357de30 {Error Domain=RBSRequestErrorDomain Code=3 "No such process found" UserInfo={NSLocalizedFailureReason=No such process found}}}
Failed to terminate process: Error Domain=com.apple.extensionKit.errorDomain Code=18 "(null)" UserInfo={NSUnderlyingError=0x13357f390 {Error Domain=RBSRequestErrorDomain Code=3 "No such process found" UserInfo={NSLocalizedFailureReason=No such process found}}}
Failed to terminate process: Error Domain=com.apple.extensionKit.errorDomain Code=18 "(null)" UserInfo={NSUnderlyingError=0x13357d770 {Error Domain=RBSRequestErrorDomain Code=3 "No such process found" UserInfo={NSLocalizedFailureReason=No such process found}}}
I would like to translate info in a three.js based web app as a 3D model in a volumetric window. Is it possible to do this in a similar manner as loading a web page in a WKWebView?
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
It seems that in iOS 18.5+ built with Xcode 16.4+, there has been a breaking change since 18.4 with 16.3 within WebKit and how the navigationAction.sourceFrame property is initialized when implementing the decidePolicy delegate method.
The flow goes:
Implement a WKNavigationActionDelegate with decidePolicy
Call WKWebView.loadHTMLString("some-string", baseURL: nil)
Upon loading the HTML content, read the value of navigationAction.sourceFrame within the decidePolicy method of the WKNavigationActionDelegate
On iOS 18.4 (and below) with Xcode 16.3 (and below);
navigationAction.sourceFrame is <uninitialized>
On iOS 18.5+ with Xcode 16.4+:
navigationAction.sourceFrame is already initialized and is equal to navigationAction.targetFrame
It appears that this change was made between minor versions of Xcode and is unexpected behavior of a minor version. Not only was this not called out in the release notes for Xcode 16.4 and iOS 18.5, but it's technically also a breaking change to the WebKit API.
Can we get insight on why this change was made and what Apple's policy is on breaking changes between minor versions of Xcode/iOS?
Thread 0 Crashed:
0 WebKit 0x00000001a1b6bf1c WKMouseDeviceObserver.connectedDeviceCount.setter + 68 (WKMouseDeviceObserver.swift:0)
1 WebKit 0x00000001a1b6bea4 @objc WKMouseDeviceObserver.connectedDeviceCount.setter + 152
2 WebKit 0x00000001a1b6d95c closure #2 in WKMouseDeviceObserver.start() + 80 (WKMouseDeviceObserver.swift:0)
3 WebKit 0x00000001a1b4e3e9 <deduplicated_symbol> + 1
4 WebKit 0x00000001a1b4e139 <deduplicated_symbol> + 1
5 WebKit 0x00000001a1b4e769 <deduplicated_symbol> + 1
6 libswift_Concurrency.dylib 0x0000000196037cdd completeTaskWithClosure(swift::AsyncContext*, swift::SwiftError*) + 1 (Task.cpp:546)