@@ -5,7 +5,7 @@ I tried to recreate Apple's alerts as much as possible. You can find these alert
5
5
6
6
![ Alert Kit v5] ( https://cdn.sparrowcode.io/github/alertkit/v5/preview-v1_2.png )
7
7
8
- For run alert just call this:
8
+ For UIKit & SwiftUI call this:
9
9
10
10
``` swift
11
11
AlertKitAPI.present (
@@ -27,25 +27,31 @@ public enum AlertViewStyle {
27
27
```
28
28
29
29
### Community
30
-
30
+
31
31
<p float =" left " >
32
32
<a href="https://twitter.com/sparrowcode_en">
33
33
<img src="https://cdn.sparrowcode.io/github%2Fbadges%2Ftwitter.png?version=4" height="52">
34
34
</a>
35
35
<a href="https://t.me/sparrowcode_en">
36
36
<img src="https://cdn.sparrowcode.io/github/badges/telegram.png?version=1" height="52">
37
37
</a>
38
- <a href="https://mastodon.social/@sparrowcode_en">
39
- <img src="https://cdn.sparrowcode.io/github/badges/mastodon.png?version=2" height="52">
40
- </a>
41
38
<a href="#apps-using">
42
39
<img src="https://cdn.sparrowcode.io/github/badges/download-on-the-appstore.png?version=4" height="52">
43
40
</a>
44
41
</p >
45
42
43
+ ## Navigate
44
+
45
+ - [ Installation] ( #installation )
46
+ - [ Swift Package Manager] ( #swift-package-manager )
47
+ - [ CocoaPods] ( #cocoapods )
48
+ - [ SwiftUI] ( #swiftui )
49
+ - [ Customisation] ( #customisation )
50
+ - [ Apps Using] ( #apps-using )
51
+
46
52
## Installation
47
53
48
- Ready to use on iOS 13+.
54
+ Ready to use on iOS 13+. Supports iOS and visionOS. Working with ` UIKit ` and ` SwiftUI ` .
49
55
50
56
### Swift Package Manager
51
57
@@ -59,7 +65,7 @@ or adding it to the `dependencies` of your `Package.swift`:
59
65
60
66
``` swift
61
67
dependencies: [
62
- .package (url : " https://github.com/sparrowcode/AlertKit" , .upToNextMajor (from : " 5.0 .0" ))
68
+ .package (url : " https://github.com/sparrowcode/AlertKit" , .upToNextMajor (from : " 5.1 .0" ))
63
69
]
64
70
```
65
71
@@ -80,11 +86,35 @@ pod 'SPAlert'
80
86
81
87
If you prefer not to use any of dependency managers, you can integrate manually. Put ` Sources/AlertKit ` folder in your Xcode project. Make sure to enable ` Copy items if needed ` and ` Create groups ` .
82
88
89
+ ## SwiftUI
90
+
91
+ You can use basic way via AlertKitAPI or call via modifier:
92
+
93
+ ``` swift
94
+ let alertView = AlertAppleMusic17View (title : " Hello" , subtitle : nil , icon : .done )
95
+
96
+ VStack {}
97
+ .alert (isPresent : $alertPresented, view : alertView)
98
+ ```
99
+
100
+ ## Customisation
101
+
102
+ If you need customisation fonts, icon, colors or any other, make view:
103
+
104
+ ``` swift
105
+ let alertView = AlertAppleMusic17View (title : " Added to Library" , subtitle : nil , icon : .done )
106
+ // Change content color
107
+ alertView.contentColor = .systemBlue
108
+ // Change font
109
+ alertView.titleLabel .font = UIFont.systemFont (ofSize : 21 )
110
+ ```
111
+
83
112
## Apps Using
84
113
85
114
<p float =" left " >
86
115
<a href="https://apps.apple.com/app/id1624477055"><img src="https://cdn.sparrowcode.io/github/apps-using/id1624477055.png?version=2" height="65"></a>
87
116
<a href="https://apps.apple.com/app/id1625641322"><img src="https://cdn.sparrowcode.io/github/apps-using/id1625641322.png?version=2" height="65"></a>
117
+ <a href="https://apps.apple.com/app/id1625641322"><img src="https://cdn.sparrowcode.io/github/apps-using/id6449774982.png?version=2" height="65"></a>
88
118
<a href="https://apps.apple.com/app/id875280793"><img src="https://cdn.sparrowcode.io/github/apps-using/id875280793.png?version=2" height="65"></a>
89
119
<a href="https://apps.apple.com/app/id743843090"><img src="https://cdn.sparrowcode.io/github/apps-using/id743843090.png?version=2" height="65"></a>
90
120
<a href="https://apps.apple.com/app/id537070378"><img src="https://cdn.sparrowcode.io/github/apps-using/id537070378.png?version=2" height="65"></a>
0 commit comments