Skip to content

Commit b233f7f

Browse files
committed
Clean code. Added SPIndicator.
1 parent 2de0187 commit b233f7f

File tree

9 files changed

+18
-21
lines changed

9 files changed

+18
-21
lines changed

Example App/SPAlert.xcodeproj/project.pbxproj

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
F43A587826564DDF009098ED /* SPAlert */,
4949
F47E1DFC26564B6A008D901C /* iOS Example */,
5050
F47E1DFB26564B6A008D901C /* Products */,
51-
F47E1E2026564BD4008D901C /* Frameworks */,
5251
);
5352
sourceTree = "<group>";
5453
};
@@ -97,13 +96,6 @@
9796
path = Controllers;
9897
sourceTree = "<group>";
9998
};
100-
F47E1E2026564BD4008D901C /* Frameworks */ = {
101-
isa = PBXGroup;
102-
children = (
103-
);
104-
name = Frameworks;
105-
sourceTree = "<group>";
106-
};
10799
/* End PBXGroup section */
108100

109101
/* Begin PBXNativeTarget section */
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Bucket
3+
uuid = "DACBB0DA-0468-4161-A467-3BEAC122757C"
4+
type = "1"
5+
version = "2.0">
6+
</Bucket>

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ Simplifies working with animated changes in table and collections. Apple's diffa
144144
#### [SparrowKit](https://github.com/ivanvorobei/SparrowKit)
145145
Collection of native Swift extensions to boost your development. Support tvOS and watchOS.
146146

147+
#### [SPIndicator](https://github.com/ivanvorobei/SPIndicator)
148+
Floating indicator, mimicrate to indicator which appear when silent mode turn on / off. Support large texts and has ready-use animatable icons like `done` and `error`.
149+
147150
## Russian Community
148151

149152
В телеграм-канале [Код Воробья](https://sparrowcode.by/telegram) пишу о iOS разработке. Помощь можно найти в [нашем чате](https://sparrowcode.by/telegram/chat).

SPAlert.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Pod::Spec.new do |s|
77
s.source = { :git => 'https://github.com/ivanvorobei/SPAlert.git', :tag => s.version }
88
s.license = { :type => "MIT", :file => "LICENSE" }
99

10-
s.author = { "Ivan Vorobei" => "[email protected]" }
10+
s.author = { 'Ivan Vorobei' => '[email protected]' }
1111
s.social_media_url = 'https://ivanvorobei.by/'
1212

1313
s.swift_version = '5.1'

Sources/SPAlert/SPAlert.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,4 @@ public enum SPAlert {
6666
let alertView = SPAlertView(message: message)
6767
alertView.present(haptic: haptic, completion: completion)
6868
}
69-
70-
@available(*, deprecated, message: "For present with custom image use preset `.custom(UIImage)`")
71-
public static func present(title: String, message: String? = nil, image: UIImage, haptic: SPAlertHaptic, completion: (() -> Void)? = nil) {
72-
let alertView = SPAlertView(title: title, message: message, preset: .custom(image))
73-
alertView.present(haptic: haptic, completion: completion)
74-
}
7569
}

Sources/SPAlert/SPAlertIconPreset.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,10 @@ public extension SPAlertIconPreset {
5252

5353
func getHaptic() -> SPAlertHaptic {
5454
switch self {
55+
case .done: return .success
5556
case .error: return .error
56-
default: return .success
57+
case .heart: return .success
58+
case .custom(_): return .none
5759
}
5860
}
5961
}

Sources/SPAlert/SPAlertView.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ import UIKit
3535
*/
3636
open class SPAlertView: UIView {
3737

38+
// MARK: - Properties
39+
40+
open var dismissByTap: Bool = true
41+
open var completion: (() -> Void)? = nil
42+
3843
// MARK: - Views
3944

4045
open var titleLabel: UILabel?
@@ -55,11 +60,6 @@ open class SPAlertView: UIView {
5560

5661
weak open var presentWindow: UIWindow? = UIApplication.shared.windows.first
5762

58-
// MARK: - Properties
59-
60-
open var dismissByTap: Bool = true
61-
open var completion: (() -> Void)? = nil
62-
6363
// MARK: - Init
6464

6565
public init(title: String, message: String? = nil, preset: SPAlertIconPreset) {

0 commit comments

Comments
 (0)