Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Swift 敏捷的当屏幕不在后台时,在接收远程通知时创建横幅_Swift_Background_Notifications_Banner - Fatal编程技术网

Swift 敏捷的当屏幕不在后台时,在接收远程通知时创建横幅

Swift 敏捷的当屏幕不在后台时,在接收远程通知时创建横幅,swift,background,notifications,banner,Swift,Background,Notifications,Banner,下面是我收到通知时的代码。我知道我可以使用PFPush创建警报,但我觉得这不是一个好方法。有没有办法创建横幅而不是警报 func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject], fetchCompletionHandler completionHandler: (UIBackgroundFetchResult) -> Void)

下面是我收到通知时的代码。我知道我可以使用PFPush创建警报,但我觉得这不是一个好方法。有没有办法创建横幅而不是警报

func application(application: UIApplication,  didReceiveRemoteNotification userInfo: [NSObject : AnyObject],  fetchCompletionHandler completionHandler: (UIBackgroundFetchResult) -> Void) {
    NSNotificationCenter.defaultCenter().postNotificationName("getMessage", object: nil)
    if application.applicationState == UIApplicationState.Active {
        //PFPush.handlePush(userInfo)
    }
    completionHandler(UIBackgroundFetchResult.NewData)
}