iOS 12 SDK Update
In the iOS 12 SDK (that ships with Xcode 10), UIApplicationLaunchOptionsKey
has now been renamed to the nested type UIApplication.LaunchOptionsKey
, so you'll want:
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
// ...
}
iOS 10 and 11 SDKs (Xcode 8 and 9)
This warning is due to the fact that the didFinishLaunchingWithOptions:
parameter of the application(_:didFinishLaunchingWithOptions:)
delegate method is now bridged to Swift as a [UIApplicationLaunchOptionsKey: Any]?
, rather than an [NSObject : AnyObject]?
.
Therefore you'll need to update your implementation to reflect this change:
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?
) -> Bool {
// ...
}
Note that neither of Xcode's suggested fixes will actually fix the problem, they'll only conceal your implementation of application(_:didFinishLaunchingWithOptions:)
from Objective-C – meaning that it'll never actually get called.