comparison 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
comparison
equal deleted inserted replaced
9:3540c7efc216 10:a793f33f05fb
1 //
2 // HapticsClass.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 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 }
20
21 func error() {
22 if user.settings.haptics {
23 let generator = UINotificationFeedbackGenerator()
24 generator.notificationOccurred(.error)
25 }
26 }
27 }