case error case success case warning case light case medium case heavy @available(iOS13.0, *) case soft @available(iOS13.0, *) case rigid case selection
publicfuncvibrate() { switchself { case .error: UINotificationFeedbackGenerator().notificationOccurred(.error) case .success: UINotificationFeedbackGenerator().notificationOccurred(.success) case .warning: UINotificationFeedbackGenerator().notificationOccurred(.warning) case .light: UIImpactFeedbackGenerator(style: .light).impactOccurred() case .medium: UIImpactFeedbackGenerator(style: .medium).impactOccurred() case .heavy: UIImpactFeedbackGenerator(style: .heavy).impactOccurred() case .soft: if#available(iOS13.0, *) { UIImpactFeedbackGenerator(style: .soft).impactOccurred() } case .rigid: if#available(iOS13.0, *) { UIImpactFeedbackGenerator(style: .rigid).impactOccurred() } case .selection: UISelectionFeedbackGenerator().selectionChanged()