My project prior to the update was working fine with swift 1.1 and Xcode 6.1.1. i just upgraded to swift 1.2 and get a weird error in my AppDelegate
func application(application:UIApplication, didReceiveRemoteNotification userInfo:NSDictionary)
and also in a class derived from UITextFieldDelegate
func textFieldDidBeginEditing(textField: UITextField!) -> Bool // called textfield for locationField clicked
saying something along the lines
Objective-C method 'application:didReceiveRemoteNotification:' provided by method 'application(:didReceiveRemoteNotification:)' conflicts with optional requirement method 'application(:didReceiveRemoteNotification:)' in protocol 'UIApplicationDelegate'
the error for the textFieldDidBeginEditing is the same:
Objective-C method 'textFieldDidBeginEditing:' provided by method 'textFieldDidBeginEditing' conflicts with optional requirement method 'textFieldDidBeginEditing' in protocol 'UITextFieldDelegate'
What is the issue?
Just rewrite the method's name (should fix itself), and copy/paste the code in the methods. This should work.
This worked for me:
Before:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool
After:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: NSDictionary?) -> Bool!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With