chore: wire in initial viewmodel and view
Signed-off-by: Alan Brault <alan.brault@visus.io>
This commit is contained in:
-2
@@ -1,2 +0,0 @@
|
||||
// The Swift Programming Language
|
||||
// https://docs.swift.org/swift-book
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
import Foundation
|
||||
import Observation
|
||||
import TempestasDomain
|
||||
|
||||
@Observable
|
||||
@MainActor
|
||||
public final class MainViewModel {
|
||||
public private(set) var isLoading: Bool = false
|
||||
|
||||
private let forecastRepository: ForecastRepository
|
||||
|
||||
public init(
|
||||
forecastRepository: ForecastRepository
|
||||
) {
|
||||
self.forecastRepository = forecastRepository
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import SwiftUI
|
||||
|
||||
public struct MainView: View {
|
||||
let viewModel: MainViewModel
|
||||
|
||||
public init (
|
||||
viewModel: MainViewModel
|
||||
) {
|
||||
self.viewModel = viewModel
|
||||
}
|
||||
|
||||
public var body: some View {
|
||||
NavigationStack {
|
||||
|
||||
}.frame(width: 320, height: 400)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user