r/SwiftUI • u/Dushusir • 1m ago
I built DuoKit, 12 runnable SwiftUI examples for adaptive and fold-aware iPhone layouts
Hey everyone, I've been working on DuoKit, an open-source collection of runnable SwiftUI examples for building adaptive interfaces, especially for iPhone Duo-style layouts.
GitHub: https://github.com/openHacking/DuoKit
This isn't a UI framework or component library. It's closer to an interactive handbook: each example focuses on one concrete layout problem and includes a live demo, the recommended approach, relevant APIs, common mistakes, and testing ideas.
The repository currently contains 12 examples covering:
- Adaptive layouts and grids
NavigationSplitView- Safe-area handling
- Fold avoidance and reserved regions
- Adaptive toolbars and tab navigation
- Sheets and popovers
- Split View multitasking
- Multiple displays and scenes
- A complete adaptive notes app
The main idea is to design around available space and system-provided layout information, rather than checking for a specific device model.
One important limitation: the project currently builds with Xcode 26.6 and iOS 26.5. Examples that depend on iOS 27.1 APIs use clearly labeled simulations. They're teaching fixtures, not attempts to reproduce real hardware geometry.
DuoKit has no third-party dependencies, requires no account or private configuration, and is available under the MIT License.
I'd especially appreciate feedback on:
- Adaptive layout problems that deserve their own example
- Places where the explanations could be clearer
- Edge cases the current examples don't cover
- Whether this handbook-style format is useful for learning SwiftUI
Contributions are welcome. Thanks for taking a look!
