translate Objective-C function implementation to Swift

How do I translate the following Objective-C code into Swift?


- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification

{

The answer depends on whether you’re using Swift 2 or Swift 3. Fortunately, Xcode can help out here:

  1. Go to your app delegate source file.

  2. In the body of the app delegate class, enter

    func receivelocal
    .
  3. Xcode’s autocomplete mechanism will show you the right method signature to use.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
translate Objective-C function implementation to Swift
 
 
Q