Xcode without Storyboard and ARC
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.
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:
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:
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:
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, orretain, you own the object - If you own it, you must later
releaseorautoreleaseit
Example:
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
- Xcode/Simulator How to run older iOS version?
- xcode/storyboard can't drag bar button to toolbar at top
- XCTest NSURLSession Stall on main thread
- XCTest/XCTest.h not found on old projects built in Xcode 6
- You have not accepted the license agreements of the following SDK components
- You need to use a Theme.AppCompat theme (or descendant) with this activity
- You need to use a Theme.AppCompat theme or descendant with this activity
- Zoom unscaled views in UIScrollView to bounds
.png&w=3840&q=75)
Tackling System Design Interview Problems
A short course that equips you with the skills to approach system design interviews methodically.
Start the free courseTrack 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.