在预期返回的函数中缺少返回' Bool' parse.com推送通知

时间:2015-01-19 13:13:57

标签: ios swift parse-platform push-notification push

我正在尝试使用swift& parse.com进行推送通知。我正在接受此错误。 我怎么能弄清楚这一点。

  func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    // Override point for customization after application launch.
    self.pushNotificationController = PushNotificationController()

    // Register for Push Notitications, if running iOS 8
    if application.respondsToSelector("registerUserNotificationSettings:") {

        let types:UIUserNotificationType = (.Alert | .Badge | .Sound)
        let settings:UIUserNotificationSettings = UIUserNotificationSettings(forTypes: types, categories: nil)

        application.registerUserNotificationSettings(settings)
        application.registerForRemoteNotifications()

    } else {
        // Register for Push Notifications before iOS 8
        application.registerForRemoteNotificationTypes(.Alert | .Badge | .Sound)
    }


 }//Missing return in a function expected to return 'Bool'

1 个答案:

答案 0 :(得分:4)

该函数需要一个布尔值作为返回值。

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool 
{
   // Your code.
   return true
}