Skip to content

Instantly share code, notes, and snippets.

@caldofran
Last active March 6, 2020 15:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caldofran/eafa9f46b9afc5f820653fe6ec92b631 to your computer and use it in GitHub Desktop.
Save caldofran/eafa9f46b9afc5f820653fe6ec92b631 to your computer and use it in GitHub Desktop.
Model navigation with value types
enum Navigation {
case section(Section)
case push(Screen)
case modal(
Screen,
UIModalPresentationStyle = .fullScreen,
completion: (() -> Void)? = nil
)
}
enum Section {
case home
case messages
case notifications
case profile
}
struct Screen {
let viewController: () -> UIViewController
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment