Skip to content

Commit 399f4c3

Browse files
committed
Fix haptic and complication bug. Update example.
1 parent 1570785 commit 399f4c3

23 files changed

+31
-5
lines changed

Assets/Application Icon.sketch

2.51 MB
Binary file not shown.

Example iOS/App/Assets.xcassets/AppIcon.appiconset/Contents.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,109 @@
11
{
22
"images" : [
33
{
4+
"filename" : "[email protected]",
45
"idiom" : "iphone",
56
"scale" : "2x",
67
"size" : "20x20"
78
},
89
{
10+
"filename" : "[email protected]",
911
"idiom" : "iphone",
1012
"scale" : "3x",
1113
"size" : "20x20"
1214
},
1315
{
16+
"filename" : "[email protected]",
1417
"idiom" : "iphone",
1518
"scale" : "2x",
1619
"size" : "29x29"
1720
},
1821
{
22+
"filename" : "[email protected]",
1923
"idiom" : "iphone",
2024
"scale" : "3x",
2125
"size" : "29x29"
2226
},
2327
{
28+
"filename" : "[email protected]",
2429
"idiom" : "iphone",
2530
"scale" : "2x",
2631
"size" : "40x40"
2732
},
2833
{
34+
"filename" : "[email protected]",
2935
"idiom" : "iphone",
3036
"scale" : "3x",
3137
"size" : "40x40"
3238
},
3339
{
40+
"filename" : "[email protected]",
3441
"idiom" : "iphone",
3542
"scale" : "2x",
3643
"size" : "60x60"
3744
},
3845
{
46+
"filename" : "[email protected]",
3947
"idiom" : "iphone",
4048
"scale" : "3x",
4149
"size" : "60x60"
4250
},
4351
{
52+
"filename" : "icon_20pt.png",
4453
"idiom" : "ipad",
4554
"scale" : "1x",
4655
"size" : "20x20"
4756
},
4857
{
58+
"filename" : "[email protected]",
4959
"idiom" : "ipad",
5060
"scale" : "2x",
5161
"size" : "20x20"
5262
},
5363
{
64+
"filename" : "icon_29pt.png",
5465
"idiom" : "ipad",
5566
"scale" : "1x",
5667
"size" : "29x29"
5768
},
5869
{
70+
"filename" : "[email protected]",
5971
"idiom" : "ipad",
6072
"scale" : "2x",
6173
"size" : "29x29"
6274
},
6375
{
76+
"filename" : "icon_40pt.png",
6477
"idiom" : "ipad",
6578
"scale" : "1x",
6679
"size" : "40x40"
6780
},
6881
{
82+
"filename" : "[email protected]",
6983
"idiom" : "ipad",
7084
"scale" : "2x",
7185
"size" : "40x40"
7286
},
7387
{
88+
"filename" : "icon_76pt.png",
7489
"idiom" : "ipad",
7590
"scale" : "1x",
7691
"size" : "76x76"
7792
},
7893
{
94+
"filename" : "[email protected]",
7995
"idiom" : "ipad",
8096
"scale" : "2x",
8197
"size" : "76x76"
8298
},
8399
{
100+
"filename" : "[email protected]",
84101
"idiom" : "ipad",
85102
"scale" : "2x",
86103
"size" : "83.5x83.5"
87104
},
88105
{
106+
"filename" : "Icon.png",
89107
"idiom" : "ios-marketing",
90108
"scale" : "1x",
91109
"size" : "1024x1024"
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

Example iOS/Info.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
<dict>
55
<key>CFBundleDevelopmentRegion</key>
66
<string>$(DEVELOPMENT_LANGUAGE)</string>
7+
<key>CFBundleDisplayName</key>
8+
<string>SPAlert</string>
79
<key>CFBundleExecutable</key>
810
<string>$(EXECUTABLE_NAME)</string>
911
<key>CFBundleIdentifier</key>

SPAlert.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@
551551
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
552552
CODE_SIGN_IDENTITY = "Apple Development";
553553
CODE_SIGN_STYLE = Automatic;
554-
DEVELOPMENT_TEAM = "";
554+
DEVELOPMENT_TEAM = G2NP4VYW5G;
555555
INFOPLIST_FILE = "Example iOS/Info.plist";
556556
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
557557
LD_RUNPATH_SEARCH_PATHS = (
@@ -573,7 +573,7 @@
573573
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
574574
CODE_SIGN_IDENTITY = "Apple Development";
575575
CODE_SIGN_STYLE = Automatic;
576-
DEVELOPMENT_TEAM = "";
576+
DEVELOPMENT_TEAM = G2NP4VYW5G;
577577
INFOPLIST_FILE = "Example iOS/Info.plist";
578578
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
579579
LD_RUNPATH_SEARCH_PATHS = (

Sources/SPAlert/SPAlertView.swift

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ open class SPAlertView: UIView {
6161

6262
open var dismissByTap: Bool = true
6363

64+
open var completion: (() -> Void)? = nil
65+
6466
// MARK: - Initializers
6567

6668
public init(title: String, message: String? = nil, preset: SPAlertIconPreset) {
@@ -163,6 +165,8 @@ open class SPAlertView: UIView {
163165

164166
// Prepare for present
165167

168+
self.completion = completion
169+
166170
let contentСolor = defaultContentColor
167171
titleLabel?.textColor = contentСolor
168172
subtitleLabel?.textColor = contentСolor
@@ -174,6 +178,8 @@ open class SPAlertView: UIView {
174178

175179
// Present
176180

181+
haptic.impact()
182+
177183
UIView.animate(withDuration: presentDismissDuration, animations: {
178184
self.alpha = 1
179185
self.transform = CGAffineTransform.identity
@@ -187,13 +193,13 @@ open class SPAlertView: UIView {
187193
})
188194
}
189195

190-
191196
@objc open func dismiss() {
192197
UIView.animate(withDuration: presentDismissDuration, animations: {
193198
self.alpha = 0
194199
self.transform = self.transform.scaledBy(x: self.presentDismissScale, y: self.presentDismissScale)
195-
}, completion: { finished in
196-
self.removeFromSuperview()
200+
}, completion: { [weak self] finished in
201+
self?.removeFromSuperview()
202+
self?.completion?()
197203
})
198204
}
199205

0 commit comments

Comments
 (0)