File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ public class NVActivityIndicatorView: UIView {
5050 private var size : CGSize
5151
5252 var animating : Bool = false
53+ var hidesWhenStopped : Bool = true
5354
5455 /**
5556 Create a activity indicator view with default type, color and size
@@ -128,6 +129,9 @@ public class NVActivityIndicatorView: UIView {
128129 Start animation
129130 */
130131 public func startAnimation( ) {
132+ if hidesWhenStopped && hidden {
133+ hidden = false
134+ }
131135 if ( self . layer. sublayers == nil ) {
132136 setUpAnimation ( )
133137 }
@@ -141,6 +145,9 @@ public class NVActivityIndicatorView: UIView {
141145 public func stopAnimation( ) {
142146 self . layer. speed = 0
143147 self . animating = false
148+ if hidesWhenStopped && !hidden {
149+ hidden = true
150+ }
144151 }
145152
146153 // MARK: Privates
You can’t perform that action at this time.
0 commit comments