0
|
1 //
|
19
|
2 // HapticsController.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
|
19
|
11 class HapticsController {
|
|
12 private var user = UserController()
|
9
|
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 }
|