HomeiOS Developmentswift - Getting "CALayer place comprises NaN" exception typically when tapping on...

swift – Getting “CALayer place comprises NaN” exception typically when tapping on textField – iOS 16 simulator


I’ve few textual content fields and typically tapping one throws following exception. Would not matter if it is empty or has textual content. It occurs randomly. I’ve not touched the textfield configuration and undecided if that is an iOS bug or what.

  • Xcode 14.2
  • iOS 16
  • Attempting on simulator
Terminating app resulting from uncaught exception 'CALayerInvalidGeometry', cause: 'CALayer place comprises NaN: [nan 428.667]. Layer: <CALayer:0x6000020dde00; place = CGPoint (0 0); bounds = CGRect (0 0; 199.667 48); delegate = <_UIEditMenuListView: 0x7f9021ca63e0; body = (-99.8333 -24; 199.667 48); alpha = 0; layer = <CALayer: 0x6000020dde00>>; sublayers = (<CALayer: 0x600002084420>); opaque = YES; opacity = 0; shadowOpacity = 0.25; shadowOffset = CGSize (0 3); shadowRadius = 12>'
*** First throw name stack:
(
    0   CoreFoundation                      0x00007ff8004288ab __exceptionPreprocess + 242
    1   libobjc.A.dylib                     0x00007ff80004dba3 objc_exception_throw + 48
    2   CoreFoundation                      0x00007ff800428789 -[NSException initWithCoder:] + 0
    3   QuartzCore                          0x00007ff80897d05e -[CALayer setPosition:] + 388
    4   UIKitCore                           0x000000010c7d00f4 -[UIView setCenter:] + 253
    5   UIKitCore                           0x000000010b5fcc2a -[_UIEditMenuPresentation _displayMenu:reason:] + 1959
    6   UIKitCore                           0x000000010b5fc387 -[_UIEditMenuPresentation displayMenu:configuration:] + 81
    7   UIKitCore                           0x000000010c78e72a __58-[UIEditMenuInteraction presentEditMenuWithConfiguration:]_block_invoke + 207
    8   UIKitCore                           0x000000010c790222 __80-[UIEditMenuInteraction _prepareMenuAtLocation:configuration:completionHandler:]_block_invoke + 87
    9   UIKitCore                           0x000000010c4ff5cb __133-[_UIContextMenuInteractionBasedTextContextInteraction _editMenuInteraction:menuForConfiguration:suggestedActions:completionHandler:]_block_invoke + 208
    10  UIKitCore                           0x000000010c4ff732 -[_UIContextMenuInteractionBasedTextContextInteraction _querySelectionCommandsForConfiguration:suggestedActions:completionHandler:] + 325
    11  UIKitCore                           0x000000010c4ff4da -[_UIContextMenuInteractionBasedTextContextInteraction _editMenuInteraction:menuForConfiguration:suggestedActions:completionHandler:] + 126
    12  UIKitCore                           0x000000010c79018f -[UIEditMenuInteraction _prepareMenuAtLocation:configuration:completionHandler:] + 296
    13  UIKitCore                           0x000000010c78e485 -[UIEditMenuInteraction presentEditMenuWithConfiguration:] + 240
    14  UIKitCore                           0x000000010c4ffd6d -[_UIContextMenuInteractionBasedTextContextInteraction presentSelectionCommandsWithConfiguration:] + 94
    15  UIKitCore                           0x000000010c553b6f -[UITextSelectionView _presentEditMenuWithPreferredDirection:replacements:] + 103
    16  UIKitCore                           0x000000010c553792 -[UITextSelectionView _showCommandsWithReplacements:isForContextMenu:forDictation:arrowDirection:] + 1487
    17  UIKitCore                           0x000000010c553157 __77-[UITextSelectionView _showCommandsWithReplacements:forDictation:afterDelay:]_block_invoke + 262
    18  libdispatch.dylib                   0x0000000104d93f5b _dispatch_client_callout + 8
    19  libdispatch.dylib                   0x0000000104d97164 _dispatch_continuation_pop + 836
    20  libdispatch.dylib                   0x0000000104daed2e _dispatch_source_invoke + 2198
    21  libdispatch.dylib                   0x0000000104da4bc7 _dispatch_main_queue_drain + 1065
    22  libdispatch.dylib                   0x0000000104da4790 _dispatch_main_queue_callback_4CF + 31
    23  CoreFoundation                      0x00007ff800387b1f __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    24  CoreFoundation                      0x00007ff800382436 __CFRunLoopRun + 2482
    25  CoreFoundation                      0x00007ff8003816a7 CFRunLoopRunSpecific + 560
    26  GraphicsServices                    0x00007ff809cb128a GSEventRunModal + 139
    27  UIKitCore                           0x000000010c1c2ad3 -[UIApplication _run] + 994
    28  UIKitCore                           0x000000010c1c79ef UIApplicationMain + 123
    29  libswiftUIKit.dylib                 0x0000000104f0fc72 $s5UIKit17UIApplicationMainys5Int32VAD_SpySpys4Int8VGGSgSSSgAJtF + 98
    30  Sevensales                          0x000000010465eb18 $sSo21UIApplicationDelegateP5UIKitE4mainyyFZ + 104
    31  Sevensales                          0x000000010465eaa7 $s10Sevensales11AppDelegateC5$mainyyFZ + 39
    32  Sevensales                          0x000000010465ebf8 primary + 24
    33  dyld                                0x0000000104a882bf start_sim + 10
    34  ???                                 0x000000010f3ab52e 0x0 + 4550473006
)
libc++abi: terminating with uncaught exception of kind NSException
*** Terminating app resulting from uncaught exception 'CALayerInvalidGeometry', cause: 'CALayer place comprises NaN: [nan 428.667]. Layer: <CALayer:0x6000020dde00; place = CGPoint (0 0); bounds = CGRect (0 0; 199.667 48); delegate = <_UIEditMenuListView: 0x7f9021ca63e0; body = (-99.8333 -24; 199.667 48); alpha = 0; layer = <CALayer: 0x6000020dde00>>; sublayers = (<CALayer: 0x600002084420>); opaque = YES; opacity = 0; shadowOpacity = 0.25; shadowOffset = CGSize (0 3); shadowRadius = 12>'
terminating with uncaught exception of kind NSException
CoreSimulator 857.14 - Gadget: iPhone 13 (13FA63E1-3A41-4553-83AF-AE5D1E551365) - Runtime: iOS 16.2 (20C52) - DeviceType: iPhone 13

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments