6
6
// Copyright © 2017 LeFal. All rights reserved.
7
7
//
8
8
9
- import Foundation
10
9
import UIKit
11
10
12
-
13
- enum DropDirection {
14
- case up
15
- case down
16
- }
17
-
18
- class WaterDropsView : UIView {
11
+ open class WaterDropsView : UIView {
19
12
20
13
///Waterdrop's direction
21
14
open var direction : DropDirection = . up
22
15
23
16
///Number of drops
24
17
open var dropNum : Int = 10
25
18
19
+ @objc
20
+ public enum DropDirection {
21
+ case up
22
+ case down
23
+ }
24
+
26
25
///Waterdrop's color
27
26
open var color : UIColor = UIColor . blue. withAlphaComponent ( 0.7 )
28
27
///The minimum size of a waterdrop
@@ -50,7 +49,7 @@ class WaterDropsView: UIView {
50
49
super. init ( frame: frame)
51
50
}
52
51
53
- init ( frame: CGRect , direction: DropDirection = . up, dropNum: Int = 10 , color: UIColor = UIColor . blue. withAlphaComponent ( 0.7 ) , minDropSize: CGFloat = 4 , maxDropSize: CGFloat = 10 , minLength: CGFloat = 0 , maxLength: CGFloat = 100 , minDuration: TimeInterval = 4 , maxDuration: TimeInterval = 12 ) {
52
+ public init ( frame: CGRect , direction: DropDirection = . up, dropNum: Int = 10 , color: UIColor = UIColor . blue. withAlphaComponent ( 0.7 ) , minDropSize: CGFloat = 4 , maxDropSize: CGFloat = 10 , minLength: CGFloat = 0 , maxLength: CGFloat = 100 , minDuration: TimeInterval = 4 , maxDuration: TimeInterval = 12 ) {
54
53
self . direction = direction
55
54
self . dropNum = dropNum
56
55
self . color = color
@@ -63,17 +62,17 @@ class WaterDropsView: UIView {
63
62
super. init ( frame: frame)
64
63
}
65
64
66
- required init ? ( coder aDecoder: NSCoder ) {
65
+ public required init ? ( coder aDecoder: NSCoder ) {
67
66
super. init ( coder: aDecoder)
68
67
}
69
68
70
- override func awakeFromNib( ) {
69
+ public override func awakeFromNib( ) {
71
70
super. awakeFromNib ( )
72
71
}
73
72
74
73
75
74
/// Required : Add water drops animation in view
76
- func addAnimation( ) {
75
+ public func addAnimation( ) {
77
76
let viewConfiguration = ViewConfig ( color: self . color,
78
77
minDropSize: self . minDropSize,
79
78
maxDropSize: self . maxDropSize,
0 commit comments