Mercurial > public > geoquiz
annotate GeoQuiz/Logic/HapticsClass.swift @ 15:f1967f8cc67b
first iteration of core data
author | Dennis C. M. <dennis@denniscm.com> |
---|---|
date | Wed, 19 Oct 2022 10:04:17 +0200 |
parents | 136928bae534 |
children |
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() { | |
14 | 15 if user.data.haptics { |
9 | 16 let generator = UINotificationFeedbackGenerator() |
17 generator.notificationOccurred(.success) | |
18 } | |
19 } | |
0 | 20 |
9 | 21 func error() { |
14 | 22 if user.data.haptics { |
9 | 23 let generator = UINotificationFeedbackGenerator() |
24 generator.notificationOccurred(.error) | |
25 } | |
26 } | |
0 | 27 } |