Skip to content

Instantly share code, notes, and snippets.

@intan1907
Last active June 16, 2021 08:54
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/de5ff8ecba83000342c6363cb52a39a3 to your computer and use it in GitHub Desktop.
Save intan1907/de5ff8ecba83000342c6363cb52a39a3 to your computer and use it in GitHub Desktop.
HeartyRecipeWidgetSmallView
// ...
struct HeartyRecipeWidgetSmallView: View {
var recipe: RecipeBaseClass?
var body: some View {
ZStack(alignment: .top) {
Color(.white)
VStack(alignment: .leading) {
Image.loadLocalImage(image: recipe?.imageURL ?? "")
.centerCropped()
.frame(height: 64)
.cornerRadius(10)
Text("\(recipe?.getTime() ?? "") • \(recipe?.serving ?? "1 portion")")
.font(.system(size: 10, weight: .regular, design: .default))
Text(recipe?.name ?? "")
.font(.system(size: 12, weight: .semibold, design: .default))
.multilineTextAlignment(.leading)
}
.padding()
}
}
}
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment