Created
June 16, 2021 09:02
-
-
Save intan1907/417e0cecb6a5943062a5701ccf2b8c8b to your computer and use it in GitHub Desktop.
HeartyRecipeWidgetView
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
import Foundation | |
import SwiftUI | |
import WidgetKit | |
import HeartyRecipeHelper | |
struct HeartyRecipeWidgetView: View { | |
var recipe: RecipeBaseClass? | |
@Environment(\.widgetFamily) var family: WidgetFamily | |
@ViewBuilder | |
var body: some View { | |
switch family { | |
case .systemSmall: | |
HeartyRecipeWidgetSmallView(recipe: recipe) | |
case .systemMedium: | |
HeartyRecipeWidgetMediumView(recipe: recipe) | |
case .systemLarge: | |
HeartyRecipeWidgetLargeView(recipe: recipe) | |
@unknown default: | |
EmptyView() | |
} | |
} | |
} | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment