Mercurial > public > lazybear
comparison LazyBear/ContentView.swift @ 287:22eba376075e
Add custom haptics
author | Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com> |
---|---|
date | Sat, 20 Mar 2021 15:01:05 +0100 |
parents | 9e23e9b0ab36 |
children | b481783c32c0 |
comparison
equal
deleted
inserted
replaced
286:c1f9ccb421d4 | 287:22eba376075e |
---|---|
8 import SwiftUI | 8 import SwiftUI |
9 | 9 |
10 struct ContentView: View { | 10 struct ContentView: View { |
11 @EnvironmentObject var hudManager: HudManager | 11 @EnvironmentObject var hudManager: HudManager |
12 @EnvironmentObject var deviceSize: DeviceSize | 12 @EnvironmentObject var deviceSize: DeviceSize |
13 @EnvironmentObject var hapticsManager: HapticsManager | |
13 | 14 |
14 // Fetch user appearence settings | 15 // Fetch user appearence settings |
15 @FetchRequest(entity: UserSettings.entity(), sortDescriptors: [NSSortDescriptor(keyPath: \UserSettings.changedAt, ascending: false)]) | 16 @FetchRequest(entity: UserSettings.entity(), sortDescriptors: [NSSortDescriptor(keyPath: \UserSettings.changedAt, ascending: false)]) |
16 var userSettings: FetchedResults<UserSettings> | 17 var userSettings: FetchedResults<UserSettings> |
17 | 18 |
62 // If this value is not optional it will cause a crash | 63 // If this value is not optional it will cause a crash |
63 .onAppear { | 64 .onAppear { |
64 // Assign device screen size to the class | 65 // Assign device screen size to the class |
65 self.deviceSize.width = geo.size.width | 66 self.deviceSize.width = geo.size.width |
66 self.deviceSize.height = geo.size.height | 67 self.deviceSize.height = geo.size.height |
68 hapticsManager.prepareHaptics() | |
67 } | 69 } |
68 } | 70 } |
69 } | 71 } |
70 } | 72 } |
71 | 73 |