Skip to content

Instantly share code, notes, and snippets.

@MoussaHellal
Created June 25, 2023 11:19
Show Gist options
  • Save MoussaHellal/fba9ccc268317099f0c0e86afe3a7e45 to your computer and use it in GitHub Desktop.
Save MoussaHellal/fba9ccc268317099f0c0e86afe3a7e45 to your computer and use it in GitHub Desktop.
Our navigation setter in Drinky
//
// DrinkyViewFactory.swift
// CompleteNavigationSwiftUI
//
// Created by Moussa on 25/6/2023.
//
import Foundation
import SwiftUI
class DrinkyViewFactory {
static func setViewForDestination(_ destination: DrinkyNavigation) -> AnyView {
switch destination {
case .drinkyDetails:
return AnyView(DrinkyDetailsView())
case .drinkyIngredients:
return AnyView(DrinkyIngedientsView())
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment