From 53f1756c42509a4b1dfd9ad24a6833b4735e8de4 Mon Sep 17 00:00:00 2001 From: Ian Jiang Date: Fri, 20 Dec 2024 09:48:17 +1100 Subject: [PATCH] show cat fact --- CatFact/CatFact/CatFactApp.swift | 4 +- CatFact/CatFact/ContentView.swift | 79 ++++++++++++++++++++++++++----- 2 files changed, 69 insertions(+), 14 deletions(-) diff --git a/CatFact/CatFact/CatFactApp.swift b/CatFact/CatFact/CatFactApp.swift index e68c743..1a75544 100644 --- a/CatFact/CatFact/CatFactApp.swift +++ b/CatFact/CatFact/CatFactApp.swift @@ -2,13 +2,11 @@ // CatFactApp.swift // CatFact // -// Created by Ian Jiang on 20/12/2024. -// import SwiftUI @main -struct CatFactApp: App { +struct CatFactsApp: App { var body: some Scene { WindowGroup { ContentView() diff --git a/CatFact/CatFact/ContentView.swift b/CatFact/CatFact/ContentView.swift index 3ca1f1a..ac3923c 100644 --- a/CatFact/CatFact/ContentView.swift +++ b/CatFact/CatFact/ContentView.swift @@ -1,24 +1,81 @@ // -// ContentView.swift -// CatFact -// -// Created by Ian Jiang on 20/12/2024. +// CatFactApp.swift +// ContentView // import SwiftUI +struct CatRow { + var image: UIImage? + var fact: String +} + struct ContentView: View { + @State var rows: [CatRow] = [] + @State var isLoading = false + var body: some View { VStack { - Image(systemName: "globe") - .imageScale(.large) - .foregroundStyle(.tint) - Text("Hello, world!") + ScrollView { + VStack { + ForEach(0..