Xcode
Storyboard
ARC
iOS Development
Objective-C

Xcode without Storyboard and ARC

Interview Questions practice on Codemia

Over 8,000 real interview questions from top companies, searchable by company and role.

Browse interview questions

Introduction

You can absolutely build an Xcode project without storyboards and without ARC, but those are two separate decisions. Removing storyboards changes how you bootstrap the UI, while disabling ARC changes how you manage memory. Modern projects often skip storyboards for programmatic UI, but avoiding ARC is usually reserved for legacy Objective-C code or specific interoperability cases.

Running Without Storyboards

If you do not want a storyboard, you create the window and root view controller yourself. In older UIKit app setups, that happens in the app delegate:

objective-c
1#import "AppDelegate.h"
2#import "RootViewController.h"
3
4@implementation AppDelegate
5
6- (BOOL)application:(UIApplication *)application
7    didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
8
9    self.window = [[[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds] autorelease];
10
11    RootViewController *root = [[[RootViewController alloc] init] autorelease];
12    UINavigationController *nav =
13        [[[UINavigationController alloc] initWithRootViewController:root] autorelease];
14
15    self.window.rootViewController = nav;
16    [self.window makeKeyAndVisible];
17    return YES;
18}
19
20@end

The important part is that the UI hierarchy is set up in code rather than loaded from Main.storyboard.

What to Remove from the Project

For a storyboard-free app, you generally:

  • Delete the storyboard file if you do not need it
  • Remove the main interface entry from the app configuration
  • Make sure the app creates the first view controller manually

After that, each screen is created in code or through nibs, depending on your preferred style.

Building the UI Programmatically

Without storyboards, views are laid out directly in code. A simple controller might look like this:

objective-c
1#import "RootViewController.h"
2
3@implementation RootViewController
4
5- (void)viewDidLoad {
6    [super viewDidLoad];
7
8    self.view.backgroundColor = [UIColor whiteColor];
9
10    UILabel *label = [[[UILabel alloc] initWithFrame:CGRectMake(40, 120, 240, 40)] autorelease];
11    label.text = @"Programmatic UI";
12    [self.view addSubview:label];
13}
14
15@end

This approach avoids storyboard merge conflicts and makes screen construction explicit, but it also means you are responsible for every layout detail.

Disabling ARC

ARC is enabled by default in most modern Xcode templates, but it can be disabled for legacy Objective-C files. The most common approach is not "turn off ARC everywhere," but "disable ARC only for specific files that require manual memory management."

You do that in build settings or compile flags, often using:

text
-fno-objc-arc

That flag can be applied to selected source files in the compile sources build phase.

What Manual Memory Management Means

If ARC is disabled, the classic ownership rule applies:

  • If you alloc, new, copy, mutableCopy, or retain, you own the object
  • If you own it, you must later release or autorelease it

Example:

objective-c
NSString *name = [[NSString alloc] initWithString:@"Ava"];
NSLog(@"%@", name);
[name release];

If you forget the release, you leak memory. If you release something you do not own, you risk a crash.

Why You Might Still Do This

There are still a few reasons a project may avoid one or both features:

  • A legacy codebase already uses manual retain-release
  • A team prefers programmatic UI over storyboard files
  • Certain old libraries or migration steps require non-ARC compilation for specific files

But for new code, the usual modern recommendation is:

  • Programmatic UI if it fits the project
  • ARC unless you have a very specific reason not to use it

Common Pitfalls

  • Removing the storyboard but forgetting to set a root view controller in code.
  • Disabling ARC broadly when only one legacy file required it.
  • Mixing ARC and non-ARC ownership rules mentally and applying the wrong one.
  • Assuming "no storyboard" automatically implies "no nibs" or "no Interface Builder" at all.

Summary

  • Storyboards and ARC are independent choices in Xcode.
  • Without storyboards, you create the window and initial view controller yourself.
  • Without ARC, you must follow Objective-C ownership rules manually.
  • Programmatic UI is still a valid architectural choice.
  • Disabling ARC should usually be limited to legacy or compatibility scenarios, not used casually for new code.

Related reading
Free course
Beginner
7 lessons
2 hours
Tackling System Design Interview Problems

A short course that equips you with the skills to approach system design interviews methodically.

Start the free course
Track what you have practised

A free account saves your progress, solutions and study plan across every problem on Codemia.

Interview Questions practice on Codemia

Over 8,000 real interview questions from top companies, searchable by company and role.

Browse interview questions

All Rights Reserved.