AnimatableActivityIndicatorView.swift 772 B

12345678910111213141516171819202122232425262728
  1. //
  2. // AnimatableIndicatorView.swift
  3. // IBAnimatableApp
  4. //
  5. // Created by Tom Baranes on 21/08/16.
  6. // Copyright © 2016 IBAnimatable. All rights reserved.
  7. //
  8. import UIKit
  9. @IBDesignable
  10. open class AnimatableActivityIndicatorView: UIView, ActivityIndicatorAnimatable {
  11. // MARK: ActivityIndicatorAnimatable
  12. open var animationType: ActivityIndicatorType = .none
  13. @IBInspectable var _animationType: String? {
  14. didSet {
  15. if let type = _animationType, let animationType = ActivityIndicatorType(string: type) {
  16. self.animationType = animationType
  17. } else {
  18. animationType = .none
  19. }
  20. }
  21. }
  22. @IBInspectable open var color: UIColor = .black
  23. @IBInspectable open var hidesWhenStopped: Bool = true
  24. open var isAnimating: Bool = false
  25. }