Mercurial > public > geoquiz
annotate GeoQuiz/Logic/HapticsClass.swift @ 10:a793f33f05fb
refactor code and fix layout
author | Dennis C. M. <dennis@denniscm.com> |
---|---|
date | Sat, 08 Oct 2022 21:36:40 +0200 |
parents | GeoQuiz/Logic/Haptics.swift@3540c7efc216 |
children | 136928bae534 |
rev | line source |
---|---|
0 | 1 // |
10
a793f33f05fb
refactor code and fix layout
Dennis C. M. <dennis@denniscm.com>
parents:
9
diff
changeset
|
2 // HapticsClass.swift |
0 | 3 // GeoQuiz |
4 // | |
5 // Created by Dennis Concepción Martín on 18/9/22. | |
6 // | |
7 | |
8 import Foundation | |
9 import SwiftUI | |
10 | |
9 | 11 class Haptics { |
12 private var user = User() | |
13 | |
14 func success() { | |
15 if user.settings.haptics { | |
16 let generator = UINotificationFeedbackGenerator() | |
17 generator.notificationOccurred(.success) | |
18 } | |
19 } | |
0 | 20 |
9 | 21 func error() { |
22 if user.settings.haptics { | |
23 let generator = UINotificationFeedbackGenerator() | |
24 generator.notificationOccurred(.error) | |
25 } | |
26 } | |
0 | 27 } |