appdelegate

pausing spritekit game using appdelegate in ios8

我的梦境 提交于 2019-12-22 00:36:27
问题 I have a pause menu in my game that I want to toggle when the i hit my home button. it works when I'm within my game, however when I hit my home button the menu comes up, but the game will not pause. when i restart the app, the menu is still there, but the game un-pauses itself. It seems like spritekit automatically pauses and restarts the game on its own when you leave and enter the app. When I'm within the app I have full control over it. But when I'm exiting/entering the app it behaves how

Push notification data not getting when app launched directly by clicking app icon

不问归期 提交于 2019-12-21 04:12:14
问题 I have a scenario in which app will get push notification and need to show that messages in home screen of my app, for that i saved the message array into user defaults from my app delegate and everything works well, but in following conditions it's not working if app is in killed state and a notification came and user triggeres the app through the app icon (not from push notification ) if app is in background and notification came and user enters to app through app icon (not from push

How to change RootViewController in AppDelegate From Other ViewController?

女生的网名这么多〃 提交于 2019-12-20 18:01:36
问题 This is didFinishLaunchingWithOptions Method in AppDelegate. Let me explain scenario, I have developed sideMenu like facebook in my app, but now I have to change the sideMenu list according to screens (ViewController) Here the side Menu is SideMenuViewController, which is an argument in contain, which ultimately becomes window's rootViewController. SO, The very basic question arises is "How to change the controller or variable which becomes rootViewController of windows" - (BOOL)application:

presentViewController in AppDelegate with delay in iOS8

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-20 09:49:01
问题 So I had a full working solution in iOS7 that displays a LoginViewController via presentViewController in the AppDelegate's didFinishLaunching. Basically I am doing something like this: UIViewController *backgroundViewController = ... self.window.rootViewController = backgroundViewController; [self.window makeKeyAndVisible]; [self.window.rootViewController presentViewController:loginViewController animated:NO ...] In iOS8 I see a jump. First I see the backgroundViewController then after about

Use AppDelegate in today extension

我怕爱的太早我们不能终老 提交于 2019-12-19 21:45:09
问题 I'm trying to build an today extension for my app. I'm using CoreData and NSFetchedResultsController and get the following error: Use of undeclared type 'AppDelegate' In this line of code: var appDel: AppDelegate = UIApplication.sharedApplication().delegate as AppDelegate. Does someone know how to solve this error / use AppDelegate in the today extension and would like to help me? 回答1: A Today Extension isn't an application, so UIApplication and AppDelegate aren't available. I'm not for sure

Use AppDelegate in today extension

我是研究僧i 提交于 2019-12-19 21:43:06
问题 I'm trying to build an today extension for my app. I'm using CoreData and NSFetchedResultsController and get the following error: Use of undeclared type 'AppDelegate' In this line of code: var appDel: AppDelegate = UIApplication.sharedApplication().delegate as AppDelegate. Does someone know how to solve this error / use AppDelegate in the today extension and would like to help me? 回答1: A Today Extension isn't an application, so UIApplication and AppDelegate aren't available. I'm not for sure

Not fetch Google user when handle sign in with another Google app using GIDSignIn

落花浮王杯 提交于 2019-12-19 16:19:19
问题 I'm using Google Sign-In for iOS and when using simulator it's working fine because no google app is installed and user is fetch, but when using my iPhone 6 device open youtube (with some registered account inside them) for handle sign in. After, when come back on the app code don't enter on this function : -(void)signIn:(GIDSignIn *) signIn didSignInForUser:(GIDGoogleUser *) user withError:(NSError *) error Anyone can help me i can't use another function for login i must call [[GIDSignIn

Handling different URL Schemes in iOS (Facebook and Instagram)

…衆ロ難τιáo~ 提交于 2019-12-19 02:53:10
问题 I am not even sure how to define the problem but here it goes. I have an application that uses Facebook SDK for user login. I followed the Facebook authorization tutorial. I am not 100% sure how it works but this part in my "AppDelegate.m" seems important. - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { return [FBSession.activeSession handleOpenURL:url]; } So far so good. Now I want to implement

Call app delegate method from view controller

妖精的绣舞 提交于 2019-12-18 18:55:08
问题 I want to know if I can call an app delegate method from another ViewController. When the app starts, the application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool i method is called. Can I call this method a second time from another view controller? 回答1: Not sure why you want to do this. You probably shouldn't, but for the purpose of answering the question here it is: // get a reference to the app delegate let appDelegate:

Pausing timer when app is in background state Swift

故事扮演 提交于 2019-12-18 15:55:12
问题 My ViewController.swift func startTimer() { timer = NSTimer().scheduleTimerWithTimerInvterval(1.0,target: self,selctor: Selector("couting"),userinfo: nil, repeats: true) } func pauseTimer() { timer.invalidate() println("pausing timer") } and this is appDelegate.swift func applicateWillResignActive(application: UIApplication) { viewController().pauseTimer() println("closing app") } It is printing pausing timer and closing app but when I open again I see it never paused. How do I do it