Ich habe einen Code erstellt, die Remote-Push-Norification erhalten, dieser Code ist in Ordnung. Jetzt muss ich zwei "Knöpfe" hinzufügen, die nach links ziehen und eine Aktion ausführen. Ich weiß, dass dieser Code unten die AktionRemote-Push-Benachrichtigungen Aktionen
func application(application: UIApplication, handleActionWithIdentifier identifier: String?, forLocalNotification notification: UILocalNotification, completionHandler:() -> Void) {
if identifier == "optin1" {
//do something
}
else identifier == "option2" {
//do something
}
completionHandler()
}
indetify verwendet wird, aber ich nicht wusste, wie die Schaltflächen erstellen links nach SWIP. Wie kann ich es tun
Das ist mein AppDelegate:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool
{
// Override point for customization after application launch.
let types:UIUserNotificationType = [.Alert, .Sound, .Badge]
application.registerForRemoteNotifications()
application.registerUserNotificationSettings(UIUserNotificationSettings(forTypes: types, categories: nil))
initLocationManager()
return true
}
func application(application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: NSError) {
//print(error)
}
func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) {
print(deviceToken)
}
func application(application: UIApplication, didReceiveRemoteNotificationuserInfo userInfo: [NSObject : AnyObject]) {
print(userInfo)
}