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
// | |
// DetailRecipeView.swift | |
// HeartyRecipe | |
// | |
// Created by Intan Nurjanah on 03/06/21. | |
// | |
import SwiftUI | |
struct DetailRecipeView: View { |
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
// | |
// RecipeRow.swift | |
// HeartyRecipe | |
// | |
// Created by Intan Nurjanah on 03/06/21. | |
// | |
import SwiftUI | |
import HeartyRecipeHelper |
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 UIKit | |
import SwiftUI | |
import HeartyRecipeHelper | |
class SceneDelegate: UIResponder, UIWindowSceneDelegate { | |
// ... | |
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { | |
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
// ... | |
struct HeartyRecipeWidgetSmallView: View { | |
var recipe: RecipeBaseClass? | |
var body: some View { | |
ZStack(alignment: .top) { | |
Color(.white) | |
VStack(alignment: .leading) { | |
Image.loadLocalImage(image: recipe?.imageURL ?? "") |
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
public struct RecipeBaseClass: Codable, Hashable { | |
// ... | |
public var ingredients: [RecipeIngredients]? | |
public var originalURL: String? | |
public var imageURL: String? | |
public var steps: [String]? | |
public var name: String? | |
public var time: Int? |
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 | |
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
// ... | |
struct HeartyRecipeWidgetMediumView: View { | |
var recipe: RecipeBaseClass? | |
var body: some View { | |
ZStack(alignment: .top) { | |
Color(.white) | |
GeometryReader { | |
geometry in |
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
// ... | |
struct HeartyRecipeWidgetLargeView: View { | |
var recipe: RecipeBaseClass? | |
var body: some View { | |
ZStack(alignment: .top) { | |
Color(.white) | |
GeometryReader { geometry in |
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
// ... | |
struct HeartyRecipeWidgetSmallView: View { | |
var recipe: RecipeBaseClass? | |
var body: some View { | |
ZStack(alignment: .top) { | |
Color(.white) | |
VStack(alignment: .leading) { | |
Image.loadLocalImage(image: recipe?.imageURL ?? "") |
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
@main | |
struct HeartyRecipeWidget: Widget { | |
let kind: String = "HeartyRecipeWidget" | |
var body: some WidgetConfiguration { | |
StaticConfiguration(kind: kind, provider: Provider()) { entry in | |
HeartyRecipeWidgetEntryView(entry: entry) | |
} | |
.configurationDisplayName("Hearty Recipe Widget") | |
.description("Display a widget with a random recipe that is updated every 1 hour.") |
NewerOlder