iosswiftuiapplicationdelegateswift4.2

UIApplicationLaunchOptionsKey not found


UIApplicationDelegate method - application(_:didFinishLaunchingWithOptions:) showing an error with Swift 4.2 (Xcode 10).

UIApplicationLaunchOptionsKey not found

What is replacement of UIApplicationLaunchOptionsKey in Swift 4.2?

enter image description here


Solution

  • 'UIApplicationLaunchOptionsKey' has been renamed to 'UIApplication.LaunchOptionsKey'. Replace 'UIApplicationLaunchOptionsKey' with 'UIApplication.LaunchOptionsKey'.

    Click on error hint, will show you solution:

    enter image description here