Mercurial > public > geoquiz
diff GeoQuiz/Controllers/HapticsController.swift @ 29:f5a2c2dab208
fix files structure
author | Dennis C. M. <dennis@denniscm.com> |
---|---|
date | Thu, 10 Nov 2022 10:27:28 +0100 |
parents | GeoQuiz/Models/Controllers/HapticsController.swift@425078c01194 |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/GeoQuiz/Controllers/HapticsController.swift Thu Nov 10 10:27:28 2022 +0100 @@ -0,0 +1,27 @@ +// +// HapticsController.swift +// GeoQuiz +// +// Created by Dennis Concepción Martín on 18/9/22. +// + +import Foundation +import SwiftUI + +class HapticsController { + private var user = UserController() + + func success() { + if user.data.haptics { + let generator = UINotificationFeedbackGenerator() + generator.notificationOccurred(.success) + } + } + + func error() { + if user.data.haptics { + let generator = UINotificationFeedbackGenerator() + generator.notificationOccurred(.error) + } + } +}