Search
Try Notion
🛠️🛠️

Granite (SwiftUI)

iOS 15.4+ | macOS 12+

NavigationNavigation

Navigating and routing components have been tricky to resolve in SwiftUI. As I always like to have my applications fit the base 3 form factors (iPhone, Mobile, MacOS). The latter 2 have exclusive design decisions to monitor when calculating tradeoffs. The primary one being the ability to spawn new windows in MacOS, while maintaining the same codebase for iOS/iPad which do not have the ability to do so. To start with the solution provided in Granite a NavigationView similar to SwiftUI’s out-of-the-box builder is where we start mapping out the Navigation Stack and its ability to react to a pushed view.
Mermaid
Preview
Copy
MainView
GraniteNavigationView
ZStack
GraniteRouter
MainView
GraniteNavigation
GraniteNavigation.Router
Push
TargetView
The nodes with rounded corners, signify structs that inherit SwiftUI’s View protocol. A high-level overview of the pathways to represent views on Granite’s Navigation Stack. Starting with GraniteNavigationView below, I explain the details of the links shown above when reaching desired experiences. These are seen in applications of mine such as Loom.

ComponentsComponents

wip

ServicesServices

wip

EventsEvents

wip