Warning, /network/kdeconnect-ios/KDE Connect/KDE Connect/Swift Backend/Haptics.swift is written in an unsupported language. File is not indexed.

0001 //
0002 //  Haptics.swift
0003 //  KDE Connect
0004 //
0005 //  Created by Claudio Cambra on 25/5/22.
0006 //
0007 
0008 import Foundation
0009 import SwiftUI
0010 
0011 // Haptics provider, for a list of the enum values see
0012 // https://developer.apple.com/documentation/uikit/uiimpactfeedbackgenerator/feedbackstyle
0013 extension UIImpactFeedbackGenerator.FeedbackStyle: CaseIterable {
0014     public var text: Text {
0015         switch self {
0016         case .light: return Text("Light", comment: "Light haptic feedback level")
0017         case .medium: return Text("Medium", comment: "Medium haptic feedback level")
0018         case .heavy: return Text("Heavy", comment: "Hard haptic feedback level")
0019         case .soft: return Text("Soft", comment: "Soft haptic feedback level")
0020         case .rigid: return Text("Rigid", comment: "Rigid haptic feedback level")
0021         @unknown default: return Text("Other", comment: "Unknown haptic feedback level")
0022         }
0023     }
0024     
0025     public static var allCases: [UIImpactFeedbackGenerator.FeedbackStyle] {
0026         return [.light, .medium, .heavy, .soft, .rigid]
0027     }
0028 }
0029 
0030 // UIImpactFeedbackGenerator.FeedbackStyle.init(rawValue: Int)
0031 
0032 let notificationHapticsGenerator: UINotificationFeedbackGenerator = UINotificationFeedbackGenerator()