view 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 source

//
//  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)
        }
    }
}