Created
June 25, 2023 11:19
-
-
Save MoussaHellal/fba9ccc268317099f0c0e86afe3a7e45 to your computer and use it in GitHub Desktop.
Our navigation setter in Drinky
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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