spot7.org logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories

Using Navigation controller for a start screen ios


This answer is based on the one here, but has been translated to Objective-C.

The problem that you are facing is that an SKScene does not have direct access to it's viewController, but just the view in which it is contained. You need to create a pointer to it manually. This can be done by creating a property for the SKScene:

@interface GameScene : SKScene

@property (strong, nonatomic) UIViewController
*viewController;

@end

Then, in the viewController class, just before [skView presentScene:scene];

scene.viewController = self;

Now, you can access the viewController directly. Simply call the segue on this viewController:

-(void)goToHomeScreen {
    [self.viewController.navigationController
popToRootViewControllerAnimated:YES];
}

You can perform other navigationController operations in a similar way.


Categories : IOS

Related to : Using Navigation controller for a start screen ios
Always display navigation bar on screen
Simply add the following CSS to whatever div(s) you want to stick: position: fixed; top: 0; //Which of these you use depends on where you want the menu to stick---- This sticks to the top left: 0; //This sticks to the left right: 0; //This sticks to the right bottom: 0; //This sticks to the bottom

Categories : HTML
Start Android navigation for result
I don't know about callbacks from Google Navigation. But if you are only interested in getting the driven distance, you could keep listening to the location updates in the background and calculate the distance yourself. The following function uses android.location.Location to calculate distance between two LatLang coordinates: public double getGeodesicDistance(LatLng from, LatLng to){ Locatio

Categories : Android
Register for remote notifications in navigation controller
If I understand correctly, it seems like you want to show a view whenever your app receives a remote notification and you want to be able to display the view from anywhere inside the app. If this is correct, the best approach would be to create a new UIWindow object and display that as an overlay on top of your app's main window. This answer describes how to create a UIWindow and display it. Addit

Categories : IOS
UIBarButtonItem clickable on left but not on right of navigation controller
If something doesn't want to react appropriately to touches, often the problem is that one of the parent view's frames has incorrect size, which doesn't fully cover the child's frame. You could check them, for example, by printing out view hierarchy in gdb: po [[UIWindow keyWindow] recursiveDescription]

Categories : IOS
how to embed navigation controller in a view programmatically?
Create a new instance of UINavigationController, with your StackTableViewController as its rootViewController. Then present the navigation controller: - (IBAction)pushToNextViewController:(id)sender { StackTableViewController *vc = [[StackTableViewController alloc]init]; UINavigationController *navCtrl = [[UINavigationController alloc] initWithRootViewController:vc]; [self presentVi

Categories : IOS
Recently Add
keychain iOS touchId prompted twice
-[UIViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x7fc748e37ea0'
Search Results Visibly Scrolling Underneath the Status Bar
How do I exclude an IOS 8 app extension from a build?
EXC_BAD_ACCESS when capturing a GPU frame
iOS 8 - Map keeps reanimating back to user location
Constantly refreshing background image of UIImageView IOS
UINavigationController keeps displaying popped view
Swift closure syntax using Shark Food Mute Switch?
MagicalRecord 3.0 not saving. No objects for the second build
iOS / Swift Can't add gesture to child class
iOS: Is there currently a way to prevent two view controllers being pushed or popped at the same time?
Checking if array contains two objects
How should turning of SCNLight affect background color?
Why don't my views show up in Storyboards and are greyed out in the left pane?
SWIFT convert NSTimeInteval to NSDate
BLE scanning is stopped when go to background?
Drawing a Rect on UIView
HLS playback via local HTTP server on iOS
Re-Assigning SKScene delegate protocol
Network lost on screen lock unlock
Annoying Xcode Error "file not found" #import
CoreData not firing faults
iOS:How do you change a view size/origin from another view controller class?
Changing a frame in viewDidLayoutSubviews
Animate multiple shapes in UIView
Add NSIntegers ONLY when 2nd NSInteger Changes Value
Facebook SDK, fetching friends
How to get Storyboard to support dynamically sized cells in UICollectionView?
GCD / NSOperationQueue EXC_BAD_ACCESS
© Copyright 2017 spot7.org Publishing Limited. All rights reserved.