Mercurial > public > geoquiz
comparison GeoQuiz/Logic/HapticsController.swift @ 19:f140bb277c96
refactor code
author | Dennis C. M. <dennis@denniscm.com> |
---|---|
date | Sun, 23 Oct 2022 00:11:38 +0100 |
parents | GeoQuiz/Logic/HapticsClass.swift@136928bae534 |
children |
comparison
equal
deleted
inserted
replaced
18:d20cf93c9812 | 19:f140bb277c96 |
---|---|
1 // | |
2 // HapticsController.swift | |
3 // GeoQuiz | |
4 // | |
5 // Created by Dennis Concepción Martín on 18/9/22. | |
6 // | |
7 | |
8 import Foundation | |
9 import SwiftUI | |
10 | |
11 class HapticsController { | |
12 private var user = UserController() | |
13 | |
14 func success() { | |
15 if user.data.haptics { | |
16 let generator = UINotificationFeedbackGenerator() | |
17 generator.notificationOccurred(.success) | |
18 } | |
19 } | |
20 | |
21 func error() { | |
22 if user.data.haptics { | |
23 let generator = UINotificationFeedbackGenerator() | |
24 generator.notificationOccurred(.error) | |
25 } | |
26 } | |
27 } |