Skip to content

Instantly share code, notes, and snippets.

@intan1907
Created June 16, 2021 09:02
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 intan1907/417e0cecb6a5943062a5701ccf2b8c8b to your computer and use it in GitHub Desktop.
Save intan1907/417e0cecb6a5943062a5701ccf2b8c8b to your computer and use it in GitHub Desktop.
HeartyRecipeWidgetView
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