@@ -28,19 +28,33 @@ import UIKit
2828public enum SPAlert {
2929
3030 /**
31- Present alert with preset and haptic.
31+ Present alert with preset and custom haptic.
3232
3333 - parameter title: Title text in alert.
3434 - parameter message: Subtitle text in alert. Optional.
3535 - parameter preset: Icon ready-use style or custom image.
3636 - parameter haptic: Haptic response with present. Default is `.success`.
3737 - parameter completion: Will call with dismiss alert.
3838 */
39- public static func present( title: String , message: String ? = nil , preset: SPAlertIconPreset , haptic: SPAlertHaptic = . success , completion: ( ( ) -> Void ) ? = nil ) {
39+ public static func present( title: String , message: String ? = nil , preset: SPAlertIconPreset , haptic: SPAlertHaptic , completion: ( ( ) -> Void ) ? = nil ) {
4040 let alertView = SPAlertView ( title: title, message: message, preset: preset)
4141 alertView. present ( haptic: haptic, completion: completion)
4242 }
4343
44+ /**
45+ Present alert with preset and automatically detect type haptic.
46+
47+ - parameter title: Title text in alert.
48+ - parameter message: Subtitle text in alert. Optional.
49+ - parameter preset: Icon ready-use style or custom image.
50+ - parameter completion: Will call with dismiss alert.
51+ */
52+ public static func present( title: String , message: String ? = nil , preset: SPAlertIconPreset , completion: ( ( ) -> Void ) ? = nil ) {
53+ let alertView = SPAlertView ( title: title, message: message, preset: preset)
54+ let haptic = preset. getHaptic ( )
55+ alertView. present ( haptic: haptic, completion: completion)
56+ }
57+
4458 /**
4559 Show only message, without title and icon.
4660
0 commit comments