Skip to content

Commit

Permalink
Remove bell sounds and notifications from watch app
Browse files Browse the repository at this point in the history
  • Loading branch information
wbreeze committed Feb 11, 2023
1 parent f6c46a3 commit 8934f9a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
4 changes: 2 additions & 2 deletions WatchClock WatchKit Extension/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import SwiftUI

struct ContentView: View {
@EnvironmentObject var clockModel: WatchClock
@EnvironmentObject var clockModel: ClockModel

var body: some View {
GeometryReader { geometry in
Expand All @@ -36,7 +36,7 @@ struct ContentView: View {

struct ContentView_Previews: PreviewProvider {
static var previews: some View {
let model = WatchClock()
let model = ClockModel()
Group {
ContentView().previewDevice("Apple Watch Series 5 - 40mm").environmentObject(model)
ContentView().previewDevice("Apple Watch Series 7 - 45mm").environmentObject(model)
Expand Down
33 changes: 17 additions & 16 deletions WatchClock WatchKit Extension/WatchClockApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,29 @@ import SwiftUI
@main
struct WatchClockApp: App {
@Environment(\.scenePhase) private var scenePhase
let clockModel = WatchClock()
let clockModel = ClockModel()

@SceneBuilder var body: some Scene {
WindowGroup {
NavigationView {
ContentView().environmentObject(clockModel).onChange(of: scenePhase) { phase in
switch phase {
case .active:
clockModel.moveToForeground()
break
case .inactive:
break
case .background:
clockModel.moveToBackground()
break
@unknown default:
fatalError("WatchClock has entered an unknown state.")
}
}
ContentView().environmentObject(clockModel)
// .onChange(of: scenePhase) { phase in
// switch phase {
// case .active:
// clockModel.moveToForeground()
// break
// case .inactive:
// break
// case .background:
// clockModel.moveToBackground()
// break
// @unknown default:
// fatalError("WatchClock has entered an unknown state.")
// }
// }
}
}

WKNotificationScene(controller: NotificationController.self, category: "myCategory")
// WKNotificationScene(controller: NotificationController.self, category: "myCategory")
}
}

0 comments on commit 8934f9a

Please sign in to comment.