Skip to content

Commit

Permalink
Add popover usage through app delegate
Browse files Browse the repository at this point in the history
  • Loading branch information
ElysiumWhale committed Jun 28, 2022
1 parent 3794b6b commit b9c5816
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
8 changes: 3 additions & 5 deletions BuildTimeTracker/BuildTimeTrackerApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ import SwiftUI

@main
struct BuildTimeTrackerApp: App {
@StateObject
private var viewModel: BuildLogsViewModel = .init()
@NSApplicationDelegateAdaptor(AppDelegate.self)
private var appDelegate

var body: some Scene {
WindowGroup {
MainView(viewModel: viewModel)
.frame(minWidth: 300, idealWidth: 300, minHeight: 300, idealHeight: 400)
.navigationTitle("Build time tracker")
EmptyView().frame(width: .zero)
}
}
}
6 changes: 3 additions & 3 deletions BuildTimeTracker/Screens/MainScreen/Views/MainView.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import SwiftUI

struct MainView: View {
@ObservedObject
var viewModel: BuildLogsViewModel
@StateObject
private var viewModel: BuildLogsViewModel = .init()

var body: some View {
VStack {
Expand All @@ -29,6 +29,6 @@ struct MainView: View {

struct ContentView_Previews: PreviewProvider {
static var previews: some View {
MainView(viewModel: .init())
MainView()
}
}

0 comments on commit b9c5816

Please sign in to comment.