appdelegate

Linking UINavigationController in Storyboard to AppDelegate

只谈情不闲聊 提交于 2019-12-11 11:19:12
问题 So I started an iOS app with the single view template. I then added a navigation controller by dragging it into the storyboard. How do I references this from my app delegate? I tried ctrl-dragging it into my AppDelegate outlet-style but that obviously doesn't work. What do I do? Instantiate one and then assign it as rootview controller? By the end of this I'd like to use the AppDelegate to set the view to the top of the navigation controller. Thanks! 回答1: In IB you should select the

Touch events in appDelegate

旧时模样 提交于 2019-12-11 11:11:45
问题 Here's my problem. I have implemented push notification in my app and it works just fine. The app receives a message Captured in appDelegates: didReceiveRemoteNotification Creates a new UIView to display that a new message is received Only problem I have is that I want the user to be able to tap on the message so that the app will open the message viewcontroller. But I can't seem to figure out how to capture this touch and then do something with it in the appDelegate. I have an NSLog in the

SpriteKit - Pause screen doesn't show when didBecomeActive

元气小坏坏 提交于 2019-12-11 10:06:30
问题 My pause system works perfectly from inside the game, and also when the app moves to the background and then becomes active again the game stays paused, but my problem now is when it becomes active my pause screen doesn't show. AppDelegate: func applicationDidBecomeActive(application: UIApplication) { NSNotificationCenter.defaultCenter().postNotificationName("Pause", object: nil) } ViewController: override func viewDidLoad() { super.viewDidLoad() let scene = GameScene() // Configure the view.

Performing a completion handler before app launches

Deadly 提交于 2019-12-11 08:15:33
问题 I am attempting to open an app in one of two ways: If the user has no UserDefaults saved, then open up a WelcomeViewController If the user has UserDefaults saved, then open up a MenuContainerViewController as a home page In step 2, if there are UserDefaults saved, then I need to log a user in using Firebase which I have through a function with a completion handler. If step 2 is the case, I want to open MenuContainerViewController within the completion block without any UI hiccups. Here is the

accessing app delegate object in XCTestCase class causes misaligned_stack_error_ swift

空扰寡人 提交于 2019-12-11 07:57:48
问题 I am trying to perform unit testing in swift. I defined my test case class like this: import XCTest import CoreData import UIKit class LazyLoadingCheckTests: XCTestCase { var appDelegate : AppDelegate = UIApplication.sharedApplication().delegate as AppDelegate override func setUp() { super.setUp() // Put setup code here. This method is called before the invocation of each test method in the class. } override func tearDown() { // Put teardown code here. This method is called after the

App Crash with exc_bad_access code Exception

柔情痞子 提交于 2019-12-11 07:40:38
问题 Let me introduce my functionality of App,I use push notification & addressbook and CoreTelephony Framework. What I am doing in my application is , When i get Push notification, I save the number from the Payload in a Appdelegate Variable(Incoming_NO) , if there is no Such contact with this number , Ill create the new contact and save it. When i receive the Call , the same contact name appears as i added before , Later on I am allowing the user to Edit the Contact if he want to save the

Simple Webview: navigationDelegate crashes on start

女生的网名这么多〃 提交于 2019-12-11 06:54:53
问题 I have a small problem with my WebView. This is what I do in my app: import UIKit import WebKit class ViewController: UIViewController, WKNavigationDelegate { @IBOutlet var webView: WKWebView! // draged from storyboard override func viewDidLoad() { super.viewDidLoad() var urlToLoad : (String) urlToLoad = "http://wwww.myapp.com" webView.sizeToFit() webView.isUserInteractionEnabled = true let url = URL(string: urlToLoad) let request = URLRequest(url:url!) //webView.navigationDelegate = self

Show two ViewController from AppDelegate

扶醉桌前 提交于 2019-12-11 05:56:23
问题 When APP is Launching - start SigninView - it's Okey. Next if success - I need showTripController(). Function work but nothing show? What's a problem? func showSigninView() { let controller = self.window?.rootViewController!.storyboard?.instantiateViewControllerWithIdentifier("DRVAuthorizationViewController") self.window?.rootViewController!.presentViewController(controller!, animated: true, completion: nil) } func showTripController() { let cv = self.window?.rootViewController!.storyboard?

UITabBarController in xamarin.ios without using StoryBoard

妖精的绣舞 提交于 2019-12-11 02:28:54
问题 In continue of my question in this post, I want to post a complete question which will be a question lots of xamarin.ios developers. My request is having TabBar in ALL UIViewControllers. So, as I know, there are two ways to realize it. First : appDelegate -> set RootViewController : TabController -> UVC1 in this case, I have NULL NavigationController and I'll have no navigationItem. and in this.NavigationController.PushViewController(new SearchViewController(), true); It makes error that

Ho to get a reference to appdelegate from Swift in a mixed application (primary language ObjC) to avoid reference loop

大憨熊 提交于 2019-12-10 17:19:56
问题 First of all I know about this: How do I get a reference to the app delegate in Swift? Second, what I need to do is to access the appdelegate properties in the Swift side of a mixed app. Basically, 1- I have a project which is started as an Objective C project. This means AppDelegate is defined in the Objective C side. 2- I have swift code working fine, I have a bridge header and I can reference things form either side on the other side. 3- Here is the problem: To reference the appdelegate in