uiviewcontroller

Present a UIViewController from SKScene

∥☆過路亽.° 提交于 2020-01-05 08:37:35
问题 I'm trying to present a UIViewController from a SKScene and I can't figure out how to do it. Most of what a Google search provides is how to present a share screen from a SKScene, but that is not what I'm trying to do. Just a regular View Controller that will have a button and a label (maybe a image as well). Here's my code in my Intro.m. This is not the Gameplay scene, just a intro screen with a title, play button and a remove ads button: #import "MyScene.h" #import "Intro.h" #import

Add NavigationController to current view

旧城冷巷雨未停 提交于 2020-01-05 08:07:43
问题 I'm using a UIScrollView to display some images, and i need to present or push another view when the user selects one part of the image.This ScrollView is created only programmatically. How i can programmatically add a navigationController to it and present another view? I tried this way but just give me the following error : Pushing a navigation controller is not supported' StatesViewController * controller = [[StatesViewController alloc]initWithNibName:@"StatesViewController" bundle:nil];

iOS - Presenting a UIViewController inside anther UIViewController

 ̄綄美尐妖づ 提交于 2020-01-05 06:40:07
问题 I dont have a very good understanding on the topic, so please bear with me I am trying to display a UIViewController inside another UIViewController. I feel like there aren't enough examples out there. I have read the documentation but being fairly new to iOS I am kind of lost. Here is my problem: I can get the child UIViewController to appear inside the parent UIViewController but the child view is not displaying right. Sorry, I cant post pictures yet. Here is my child - UIViewController.

iOS - Presenting a UIViewController inside anther UIViewController

馋奶兔 提交于 2020-01-05 06:39:13
问题 I dont have a very good understanding on the topic, so please bear with me I am trying to display a UIViewController inside another UIViewController. I feel like there aren't enough examples out there. I have read the documentation but being fairly new to iOS I am kind of lost. Here is my problem: I can get the child UIViewController to appear inside the parent UIViewController but the child view is not displaying right. Sorry, I cant post pictures yet. Here is my child - UIViewController.

When programming iOS ViewControllers should you call parent class methods before or after your own code?

£可爱£侵袭症+ 提交于 2020-01-05 04:31:06
问题 A new iOS ViewControllers created from a template contains several "boilerplate" methods that call their parent class methods. -(void) viewDidLoad { [super viewDidLoad]; } - (void) viewDidUnload { [super viewDidUnload]; } - (void) dealloc { [super dealloc]; } When modify these classes, should I put my own code before or after the parent class calls? - (void) viewDidLoad { // Should I put my code here? [super viewDidLoad]; // Or here? } 回答1: This is applicable for all OOP in general. In

Custom UITabBarController Problems with View Controllers and Views

不羁的心 提交于 2020-01-05 02:32:27
问题 I'm writing a custom UITabBarController so I can fully control appearance of the tab bar. I've got it all working so I have an array of view controllers that it handles. The controller has a main view which fills the screen, and inside it it has a UIView at the bottom for the tab bar. That tab bar view has a button for each view controller. When buttons are pressed I add the view controller's view to the main view, and set it's frame so that it doesn't cover the tab bar view: controller.view

navigationController pushed ViewControllers won't autorotate

无人久伴 提交于 2020-01-04 17:45:14
问题 I'm having difficulty getting a navigation controller to autorotate correctly. The display will autorotate on the initial view (root view controller), but it will not rotate on any new views that are pushed on. It keeps the view orientation that the initial view had when pushed. In my App Delegate I have a navigation controller and push it's view. [window addSubview:navigationController.view]; [window makeKeyAndVisible]; In the root view controller I allow all orientations and I push other

navigationController pushed ViewControllers won't autorotate

旧街凉风 提交于 2020-01-04 17:45:12
问题 I'm having difficulty getting a navigation controller to autorotate correctly. The display will autorotate on the initial view (root view controller), but it will not rotate on any new views that are pushed on. It keeps the view orientation that the initial view had when pushed. In my App Delegate I have a navigation controller and push it's view. [window addSubview:navigationController.view]; [window makeKeyAndVisible]; In the root view controller I allow all orientations and I push other

Updating a xib view's position after a uiviewcontroller loads?

自作多情 提交于 2020-01-04 13:42:27
问题 I have a simple UIViewController which has a corresponding .xib file. ViewController *v = [[ViewController alloc] initWithNibName:@"ViewController" bundle:[NSBundle mainBundle]]; [self.navigationController pushViewController:v animated:YES]; In this .xib file, I have a UILabel, which is positioned in the middle of the screen. I would like to move this label to a new position once the view is loaded, but before it is visible: label.center = CGPointMake(0,0); When I try putting the above code

Bounds and Frame size in viewDidLoad

主宰稳场 提交于 2020-01-04 06:03:30
问题 I push a view controller ( mainVC ) and add some subviews to it. Most of these views are built on-demand, as the user takes some action. When I build each view, I refer to mainVC.view.bounds to size the view. The ones that are built on demand size just fine, but the first one (which I add in viewDidLoad ) does not seem to account for either the hidden navigation bar or the unhidden toolbar - I'm not sure which. Other questions seem to assure me that viewDidLoad is the correct place to refer