Swift: println () shows nothing in "View device logs" under "Devices" tab
1 answer
Finally I got a solution for this. We can also use NSLog () for quick code. so where we want to print the log you use the NSLog () function. Example,
func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) {
var deviceTokenOrigin = deviceToken.description.stringByTrimmingCharactersInSet(NSCharacterSet(charactersInString: "<>"))
var deviceTokenFiltered = deviceTokenOrigin.stringByReplacingOccurrencesOfString(" ", withString: "")
self.deviceTocken = deviceTokenFiltered
NSLog("DeviceToken : %@", deviceTokenFiltered)
}
+9
source to share