How to switch to different Storyboard for iPhone 5?

I was looking for the same answer couple of weeks ago here’s my solution hope helps.. -(void)initializeStoryBoardBasedOnScreenSize { if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone) { // The iOS device = iPhone or iPod Touch CGSize iOSDeviceScreenSize = [[UIScreen mainScreen] bounds].size; if (iOSDeviceScreenSize.height == 480) { // iPhone 3GS, 4, and 4S and iPod Touch 3rd and … Read more

iOS 7 | Navigation bar / Toolbar buttons very close to status bar

The navigation bars or toolbars have to be at (0, viewController.topLayoutGuide.length) with bar positioning of UIBarPositionTopAttached. You should set the delegate of your navigation bar or your toolbar to your view controller, and return UIBarPositionTopAttached. If positioned correctly, you will have the result in your third image. More information here: https://developer.apple.com/documentation/uikit/uibarpositioningdelegate?language=objc

How do I create a segue that can be called from a button that is created programmatically?

Here is how to set up a segue so that it can be called programmatically. Control drag from the ViewController icon in the first view controller to the second view controller. Click on the segue arrow between the two view controllers, and in the Attributes Inspector on the right, give the segue an Identifier (tableau … Read more

Segue to another storyboard?

Yes, but you have to do it programmatically: // Get the storyboard named secondStoryBoard from the main bundle: UIStoryboard *secondStoryBoard = [UIStoryboard storyboardWithName:@”secondStoryBoard” bundle:nil]; // Load the initial view controller from the storyboard. // Set this by selecting ‘Is Initial View Controller’ on the appropriate view controller in the storyboard. UIViewController *theInitialViewController = [secondStoryBoard instantiateInitialViewController]; … Read more

Retrieve custom prototype cell height from storyboard?

For static (non-data-driven) height, you can just dequeue the cell once and store the height: – (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { static NSNumber *height; if (!height) { UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:@”MyCustomCell”]; height = @(cell.bounds.size.height); } return [height floatValue]; } For dynamic (data-driven) height, you can store a prototype cell in the view controller and … Read more

Xcode without Storyboard and ARC

Create a project with an Empty application and Add any viewcontroller (i added TestViewController here) – (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. TestViewController *test = [[TestViewController alloc] initWithNibName:@”TestViewController” bundle:nil]; UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:test]; self.window.rootViewController = nav; [self.window makeKeyAndVisible]; … Read more