@@ -33,6 +33,7 @@ extension View {
33
33
duration: TimeInterval = 2.0 ,
34
34
haptic: SPAlertHaptic = . none
35
35
) -> some View {
36
+
36
37
if isPresent. wrappedValue {
37
38
let alertCompletion = alertView. completion
38
39
let alertDismiss = {
@@ -45,36 +46,37 @@ extension View {
45
46
return self
46
47
}
47
48
48
- public func SPAlert( isPresent: Binding < Bool > ,
49
- title: String = " " ,
50
- message: String ? = nil ,
51
- duration: TimeInterval = 2.0 ,
52
- dismissOnTap: Bool = true ,
53
- preset: SPAlertIconPreset = . done,
54
- haptic: SPAlertHaptic = . none,
55
- layout: SPAlertLayout ? = nil ,
56
- completion: ( ( ) -> Void ) ? = nil
49
+ public func SPAlert(
50
+ isPresent: Binding < Bool > ,
51
+ title: String = " " ,
52
+ message: String ? = nil ,
53
+ duration: TimeInterval = 2.0 ,
54
+ dismissOnTap: Bool = true ,
55
+ preset: SPAlertIconPreset = . done,
56
+ haptic: SPAlertHaptic = . none,
57
+ layout: SPAlertLayout ? = nil ,
58
+ completion: ( ( ) -> Void ) ? = nil
57
59
) -> some View {
60
+
58
61
let alertView = SPAlertView ( title: title, message: message, preset: preset)
59
62
alertView. dismissByTap = dismissOnTap
60
63
alertView. layout = layout ?? SPAlertLayout ( for: preset)
61
64
alertView. completion = completion
62
-
63
65
return SPAlert ( isPresent: isPresent, alertView: alertView, duration: duration, haptic: haptic)
64
66
}
65
67
66
- public func SPAlert( isPresent: Binding < Bool > ,
67
- message: String ,
68
- duration: TimeInterval = 2.0 ,
69
- dismissOnTap: Bool = true ,
70
- haptic: SPAlertHaptic = . none,
71
- completion: ( ( ) -> Void ) ? = nil
68
+ public func SPAlert(
69
+ isPresent: Binding < Bool > ,
70
+ message: String ,
71
+ duration: TimeInterval = 2.0 ,
72
+ dismissOnTap: Bool = true ,
73
+ haptic: SPAlertHaptic = . none,
74
+ completion: ( ( ) -> Void ) ? = nil
72
75
) -> some View {
73
76
74
77
let alertView = SPAlertView ( message: message)
75
78
alertView. dismissByTap = dismissOnTap
76
79
alertView. completion = completion
77
-
78
80
return SPAlert ( isPresent: isPresent, alertView: alertView, duration: duration, haptic: haptic)
79
81
}
80
82
}
0 commit comments