Post

Replies

Boosts

Views

Activity

JavaScript Not Executing in WebView When Modally Presenting UIViewController on iOS 17.5.1
Issue Summary: I have encountered an issue where JavaScript does not execute in a WebView when another UIViewController is presented modally with modalPresentationStyle.fullScreen. This problem only occurs on physical devices running iOS 17.5.1. The issue is not present on iOS 17.5 simulators or devices running iOS 17.4.1 or earlier. Reproduction Steps: Create a ViewController with a WebView. Load a web page (e.g., https://apple.com) in the WebView. Present another ViewController modally with modalPresentationStyle.fullScreen. Verify that JavaScript execution in the initial WebView stops working. Test Code: import UIKit import WebKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Set up the WebView let configuration = WKWebViewConfiguration() let webView = WKWebView(frame: view.frame, configuration: configuration) view.addSubview(webView) webView.frame = view.frame if #available(iOS 16.4, *) { webView.isInspectable = true } else { // Fallback on earlier versions } webView.load(URLRequest(url: URL(string: "https://apple.com")!)) } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) let navigationController = UINavigationController(rootViewController: TargetViewController()) navigationController.modalPresentationStyle = .fullScreen present(navigationController, animated: true) } } class TargetViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() // Set up the WebView let webView = WKWebView(frame: view.frame, configuration: WKWebViewConfiguration()) view.addSubview(webView) webView.frame = view.frame if #available(iOS 16.4, *) { webView.isInspectable = true } else { // Fallback on earlier versions } webView.load(URLRequest(url: URL(string: "https://apple.com")!)) } } Observations: The JavaScript within the WebView stops executing only on physical devices running iOS 17.5.1. This issue does not occur on the iOS 17.5 simulator. Devices running iOS 17.4.1 or earlier do not experience this issue. Request for Assistance: Could you please provide any insights or potential workarounds for this issue? Additionally, if this is a known bug, any information on upcoming fixes would be highly appreciated. Thank you.
3
0
987
Jun ’24
No longer invalidateIntrinsicContentSize() invokes intrinsicContentSize for UICollectionViewCell/UITableViewCell in iOS 16?
I've used invalidateIntrinsicContentSize() in UICollectionViewCell to calculate custom UI. But it doesn't invoke intrinsicContentSize on iOS beta 16 devices.. class DynamicCell: UICollectionViewCell { func invokeResize() { cell.subviews.forEach { $0.resize() } // it doesn't invoke intrinsicContentSize from iOS 16 beta ?? invalidateIntrinsicContentSize() } override func intrinsicContentSize: CGSize { return calculateDynamicCellSize() } } I don't know if it is a bug or a specification that occurred while implementing UICollectionView.selfSizingInvalidation property. I could revise this code for iOS beta 16 using parent's( UICollectionReusableView | UIView ) methods like below. class RevisedDynamicCell: UICollectionViewCell { func invokeResize() { cell.subviews.forEach { $0.resize() } if #available(iOS 16.0, *) { // It works because it called UIView.invalidateIntrinsicContentSize invalidateUIViewIntrinsicContentSize() } else { invalidateIntrinsicContentSize() } } override func intrinsicContentSize: CGSize { return calculateDynamicCellSize() } } extension UICollectionReusableView { func invalidateUIViewIntrinsicContentSize() { super.invalidateIntrinsicContentSize() } }```
1
0
1.5k
Jun ’22
AppDelegate applicationSignificantTimeChange runs before didFinishLaunchingWithOptions gets executed
In AppDelegate, I made several dependency injections in didFinishLaunchWithOptions, because I'm sure it is be first to call by AppDelegate. But I found that the app crashed several times because some DIs in applicationSignificantTimeChange are not set. (I could check it in Firebase Crashlytics.) Is it possible the app calls applicationSignificantTimeChange before didFinshLaunchWithOptions? Are there any other methods in AppDelegate that are called before didFinishLaunchWithOptions? (
0
0
526
Aug ’21
UIViewController _popovercontroller crash
I cannot reproduce the crash what I got, but there is an old crash issue.. It is a crash stack that I get from Xcode below... Incident Identifier: EDABE3CC-2E48-4D20-A43E-A06939283A71 Hardware Model: iPhone10,2 AppVariant: 1:iPhone10,2:13 Code Type: ARM-64 (Native) Role: Foreground Parent Process: launchd [1] Date/Time: 2021-04-16 18:00:38.7526 +0900 Launch Time: 2021-04-16 18:00:26.7419 +0900 OS Version: iPhone OS 14.4.2 (18D70) Release Type: User Baseband Version: 6.41.01 Report Version: 104 Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_PROTECTION_FAILURE at 0x000000016dc0fff0 VM Region Info: 0x16dc0fff0 is in 0x16dc0c000-0x16dc10000; bytes after start: 16368 bytes before end: 15 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL MALLOC_LARGE 11e300000-11e314000 [ 80K] rw-/rwx SM=PRV GAP OF 0x4f8f8000 BYTES-- STACK GUARD 16dc0c000-16dc10000 [ 16K] ---/rwx SM=NUL ... for thread 0 Stack 16dc10000-16dd0c000 [ 1008K] rw-/rwx SM=COW thread 0 Termination Signal: Segmentation fault: 11 Termination Reason: Namespace SIGNAL, Code 0xb Terminating Process: exc handler [4014] Triggered by Thread: 0 Thread 0 name: Thread 0 Crashed: 0 libobjc.A.dylib 0x00000001ba582c78 lookUpImpOrForwardTryCache + 0 (objc-runtime-new.mm:6368) 1 libobjc.A.dylib 0x00000001ba58f9a4 objc_loadWeakRetained + 336 (NSObject.mm:575) 2 UIKitCore 0x00000001a83a2f34 -[UIViewController _popoverController] + 120 (UIViewController.m:6374) 3 UIKitCore 0x00000001a8394f88 -[UIViewController nextResponder] + 64 (UIViewController.m:2646) 4 UIKitCore 0x00000001a8a8ccf4 -[UIResponder _containedInAbsoluteResponderChain] + 24 (UIResponder.m:257) 5 UIKitCore 0x00000001a8a8cd0c -[UIResponder _containedInAbsoluteResponderChain] + 48 (UIResponder.m:257) 6 UIKitCore 0x00000001a8a8cd0c -[UIResponder _containedInAbsoluteResponderChain] + 48 (UIResponder.m:257) ... 510 UIKitCore 0x00000001a8a8cd0c -[UIResponder _containedInAbsoluteResponderChain] + 48 (UIResponder.m:257) Thread 1: 0 libsystem_pthread.dylib 0x00000001eea1486c start_wqthread + 0 Thread 2: 0 libsystem_pthread.dylib 0x00000001eea1486c start_wqthread + 0 Thread 3 name: Thread 3: 0 libsystem_kernel.dylib 0x00000001d212b290 __ulock_wait + 8 1 libsystem_platform.dylib 0x00000001eea00dec _os_unfair_lock_lock_slow + 192 2 libobjc.A.dylib 0x00000001ba58f8c0 objc_loadWeakRetained + 108 (lock_private.h:716) 3 libobjc.A.dylib 0x00000001ba58fab8 objc_loadWeak + 20 (NSObject.mm:608) 4 QuartzCore 0x00000001a93c349c CA::Context::retain_objc_contexts() + 196 (x-weak.h:119) 5 QuartzCore 0x00000001a9516fc4 +[CAContext allContexts] + 12 (CAContext.mm:86) 6 UIKitCore 0x00000001a8aad280 +[UIWindow _windowWithContextId:] + 84 (UIWindow.m:7270) 7 UIKitCore 0x00000001a8b09450 _UIEventHIDUIWindowForHIDEvent + 40 (UIEventHIDHelpers.m:310) 8 UIKitCore 0x00000001a8b09688 _UIEventHIDShouldTransformEvent + 16 (UIEventHIDHelpers.m:482) 9 UIKitCore 0x00000001a8aeef68 -[_UIHIDTransformer _inputEventsForHIDEvent:] + 60 (_UIHIDTransformer.m:854) 10 UIKitCore 0x00000001a8aeebf4 -[_UIHIDTransformer handleHIDEvent:] + 68 (_UIHIDTransformer.m:823) 11 UIKitCore 0x00000001a8b081a8 ___iosMacEventExtractionFilter_block_invoke_2 + 80 (UIEventFetcher.m:203) 12 UIKitCore 0x00000001a8b05c64 __30-[UIEventFetcher filterEvents]_block_invoke + 452 (UIEventFetcher.m:1204) 13 UIKitCore 0x00000001a8b052f4 -[UIEventFetcher _receiveHIDEventInternal:] + 464 (UIEventFetcher.m:561) 14 IOKit 0x00000001b0991888 __IOHIDEventSystemClientQueueCallback + 280 (IOHIDEventSystemClient.c:1171) 15 CoreFoundation 0x00000001a614bb54 __CFMachPortPerform + 172 (CFMachPort.c:537) 16 CoreFoundation 0x00000001a616f420 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56 (CFRunLoop.c:1991) 17 CoreFoundation 0x00000001a616e834 __CFRunLoopDoSource1 + 588 (CFRunLoop.c:2131) 18 CoreFoundation 0x00000001a61689f4 __CFRunLoopRun + 2332 (CFRunLoop.c:3146) 19 CoreFoundation 0x00000001a6167ba0 CFRunLoopRunSpecific + 572 (CFRunLoop.c:3242) 20 Foundation 0x00000001a73877f8 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 228 (NSRunLoop.m:374) 21 Foundation 0x00000001a73876d8 -[NSRunLoop(NSRunLoop) runUntilDate:] + 88 (NSRunLoop.m:421) 22 UIKitCore 0x00000001a8b05054 -[UIEventFetcher threadMain] + 504 (UIEventFetcher.m:838) 23 Foundation 0x00000001a74e44bc __NSThread__start__ + 848 (NSThread.m:724) 24 libsystem_pthread.dylib 0x00000001eea0fc9c _pthread_start + 288 (pthread.c:881) 25 libsystem_pthread.dylib 0x00000001eea14880 thread_start + 8 Thread 4: 0 libsystem_pthread.dylib 0x00000001eea1486c start_wqthread + 0 Thread 0 crashed with ARM Thread State (64-bit): x0: 0x000000010b8ad800 x1: 0x00000001f1f3dc83 x2: 0x0000000282587850 x3: 0x0000000000000001 x4: 0x0000000000000008 x5: 0x0000000000000001 x6: 0x0000000000000000 x7: 0x0000000281f9f270 x8: 0x00000001f1f3d000 x9: 0x0000000282587d90 x10: 0x0000000000000000 x11: 0x00ff00010b98a000 x12: 0x00000000000000fc x13: 0x000000010b98afb0 x14: 0x0000000000000000 x15: 0x00000001144065d0 x16: 0x00000001ba58f854 x17: 0x00000001a83a2ebc x18: 0x0000000000000000 x19: 0x000000010b8ad800 x20: 0x00000001ff9a0740 x21: 0x00000001f1f3dc83 x22: 0x0000000282587850 x23: 0x0000000105693960 x24: 0x00000001ff9a0640 x25: 0x000000010b406a80 x26: 0x000000010fb054f0 x27: 0x00000001f1c14883 x28: 0x0000000281f9f270 fp: 0x000000016dc10050 lr: 0x00000001ba58f9a4 sp: 0x000000016dc10020 pc: 0x00000001ba582c78 cpsr: 0x20000000 esr: 0x92000047 (Data Abort) byte write Translation fault
0
0
539
Apr ’21