iOS Storyboard Best Practices
Legacy interoperability guidance for storyboard-heavy code that still exists in clinic projects. Not for new SwiftUI clinic feature development.
Comprehensive UI design and architecture guide for Xcode Storyboard and Interface Builder, focused on building maintainable, adaptive, and accessible iOS interfaces. Contains 45 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.
Clinic Architecture Contract (iOS 26 / Swift 6.2)
All guidance in this skill assumes the clinic modular MVVM-C architecture:
- Feature modules import
Domain+DesignSystemonly (neverData, never sibling features) - App target is the convergence point and owns
DependencyContainer, concrete coordinators, and Route Shell wiring Domainstays pure Swift and defines models plus repository,*Coordinating,ErrorRouting, andAppErrorcontractsDataowns SwiftData/network/sync/retry/background I/O and implements Domain protocols- Read/write flow defaults to stale-while-revalidate reads and optimistic queued writes
- ViewModels call repository protocols directly (no default use-case/interactor layer)
When to Apply
Reference these guidelines when:
- Creating or modifying Storyboard scenes in Xcode Interface Builder
- Setting up Auto Layout constraints for adaptive layouts
- Designing navigation flows with segues and storyboard references
- Configuring size classes and trait variations for universal apps
- Reviewing storyboard XML diffs and resolving merge conflicts
Rule Categories by Priority
| Priority | Category | Impact | Prefix |
|----------|----------|--------|--------|
| 1 | Storyboard Architecture | CRITICAL | arch- |
| 2 | Auto Layout Constraints | CRITICAL | layout- |
| 3 | Navigation & Segues | HIGH | nav- |
| 4 | Adaptive Layout & Size Classes | HIGH | adapt- |
| 5 | View Hierarchy & Stack Views | MEDIUM-HIGH | view- |
| 6 | Accessibility & VoiceOver | MEDIUM | ally- |
| 7 | Version Control & Collaboration | MEDIUM | vcs- |
| 8 | Debugging & Inspection | LOW-MEDIUM | debug- |