What describes the Application Delegate best? How does it fit into the whole concept?

In Cocoa, a delegate is an object that another object defers to on questions of behavior and informs about changes in its state. For instance, a UITableViewDelegate is responsible for answering questions about how the UITableView should behave when selections are made or rows are reordered. It is the object that the UITableView asks when … Read more

Watchkit , openParentApplication with WatchKit Extension

Well, I would not recommend you using anything, related to network operations on watch itself. First of all because Apple does not recommend to do it for obvious reasons. The only network thing that is performed on the watch directly is loading images. I have been struggling with network operations and watch for like a … Read more

Open a view controller when a iOS push notification is received

You may be having issues with the if (applicationIsActive) condition. Put a breakpoint on -didReceiveRemoteNotification and see whether it executes in different scenarios and see if it goes within the if-condition. (unrelated to a certain extent but worth checking) this question: didReceiveRemoteNotification when in background Note: -didReceiveRemoteNotification will not execute if your app was (initially) … Read more

Get device token for push notification

NOTE: The below solution no longer works on iOS 13+ devices – it will return garbage data. Please use following code instead: + (NSString *)hexadecimalStringFromData:(NSData *)data { NSUInteger dataLength = data.length; if (dataLength == 0) { return nil; } const unsigned char *dataBuffer = (const unsigned char *)data.bytes; NSMutableString *hexString = [NSMutableString stringWithCapacity:(dataLength * 2)]; … Read more

Opening view controller from app delegate using swift

You have to set ViewController StoryBoardId property as below image. open viewController using coding as below in swift func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { let mainStoryboardIpad : UIStoryboard = UIStoryboard(name: “Main”, bundle: nil) let initialViewControlleripad : UIViewController = mainStoryboardIpad.instantiateViewControllerWithIdentifier(“Circles”) as UIViewController self.window = UIWindow(frame: UIScreen.main.bounds) self.window?.rootViewController = initialViewControlleripad self.window?.makeKeyAndVisible() return true … Read more