0
|
1 //
|
|
2 // Haptics.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
|
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 }
|