Objective-C method conflicts with optional requirement method Swift

前端 未结 5 1117
走了就别回头了
走了就别回头了 2020-12-13 03:59

After the Xcode update, the compiler began to throw an error on the working code (both functions are in the AppDelegate.swift).

func application(application:         


        
5条回答
  •  南笙
    南笙 (楼主)
    2020-12-13 04:44

    The type of the launchOptions parameter of the didFinishLaunchingWithOptions function was changed in XCode 6.3:

    "launchOptions: NSDictionary?" has become "launchOptions: [NSObject: AnyObject]?"

    Just change your function header to match the following:

    func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool
    

提交回复
热议问题