IQKeyboardManager: Fatal Exception: NSInvalidArgumentException -[UIWindow windowScene]

Describe the bug Have users reporting crashes with my app that is using your project. Can’t seem to personally reproduce sadly so this will be kind of a long shot. Appreciate any advice you may have.

Fatal Exception: NSInvalidArgumentException -[UIWindow windowScene]: unrecognized selector sent to instance 0x113e6f000 IQKeyboardManager.adjustPosition() IQKeyboardManager.swift - Line 975

To Reproduce Sadly, haven’t been able to personally produce.

Expected behavior Not crash.

Screenshots Screen_Shot_2020-05-11_at_23_13_24

Demo Project N/A

Versions

Xcode: 11.3.0 Mac OS: 10.15.1 Simulator/Device: 13.2.2 (also reported on 13.1.1, 13.3.1, 13.3.0, 13.2.0) Simulator/Device Name: iPhone XR Library Version: 6.4.0

Additional context

Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x1cb8aa98c __exceptionPreprocess
1  libobjc.A.dylib                0x1caa839f8 objc_exception_throw
2  CoreFoundation                 0x1cb7c71c8 -[NSOrderedSet initWithSet:copyItems:]
3  UIKitCore                      0x1f81e1220 -[UIResponder doesNotRecognizeSelector:]
4  CoreFoundation                 0x1cb8b01d4 ___forwarding___
5  CoreFoundation                 0x1cb8b1e6c _CF_forwarding_prep_0
6  MYAPP                       0x10054bff4 IQKeyboardManager.adjustPosition() + 975 (IQKeyboardManager.swift:975)
7  MYAPP                       0x100559138 partial apply for closure #1 in IQKeyboardManager.optimizedAdjustPosition() + 921 (IQKeyboardManager.swift:921)
8  MYAPP                       0x100295b80 thunk for @escaping @callee_guaranteed () -> () (<compiler-generated>)
9  Foundation                     0x1cc30fec8 __NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__
10 Foundation                     0x1cc21c2e0 -[NSBlockOperation main]
11 Foundation                     0x1cc21b7c8 -[__NSOperationInternal _start:]
12 Foundation                     0x1cc311c4c __NSOQSchedule_f
13 libdispatch.dylib              0x1cb2977f4 _dispatch_block_async_invoke2
14 libdispatch.dylib              0x1cb2e97d4 _dispatch_client_callout
15 libdispatch.dylib              0x1cb297008 _dispatch_main_queue_callback_4CF$VARIANT$mp
16 CoreFoundation                 0x1cb83c32c __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__
17 CoreFoundation                 0x1cb837264 __CFRunLoopRun
18 CoreFoundation                 0x1cb8367c0 CFRunLoopRunSpecific
19 GraphicsServices               0x1cda3779c GSEventRunModal
20 UIKitCore                      0x1f81b5c38 UIApplicationMain
21 ???                            0x102d12360 (Missing)
22 MYAPP                       0x1001b0500 main + 15 (MyView.swift:15)
23 libdyld.dylib                  0x1cb2fa8e0 start
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
//...
        IQKeyboardManager.shared.enable = true
        IQKeyboardManager.shared.shouldResignOnTouchOutside =  true
//...
}

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 18 (3 by maintainers)

Most upvoted comments

俺解决了😎

有偿解决解决可以吗?