       animationLayer.isHidden = hidesWhenStopped
    }
 }
+
+private extension KRActivityIndicatorView {
+   func viewResized() {
+      let layerSize: CGFloat = isLarge ? 50 : 20
+      animationLayer.frame = CGRect(x: 0, y: 0, width: layerSize, height: layerSize)
+      animationLayer.position = CGPoint(x: layer.position.x-layer.frame.origin.x, y: layer.position.y-layer.frame.origin.y)
+      animationLayer.isHidden = !isAnimating && hidesWhenStopped
+      drawIndicatorPath()
+   }
+
+   func drawIndicatorPath() {
+      animationLayer.sublayers?.forEach { $0.removeFromSuperlayer() }
+
+      let paths = KRActivityIndicatorPath.getPath(isLarge: isLarge)
+      let colors = style.getGradientColors(dividedIn: paths.count)
+
+      paths.enumerated().forEach { index, path in
+         let pathLayer = CAShapeLayer()
+         pathLayer.frame = animationLayer.bounds
+         pathLayer.fillColor = colors[index].cgColor
+         pathLayer.lineWidth = 0
+         pathLayer.path = path
+         animationLayer.addSublayer(pathLayer)
+      }
+   }
+}

   public required init?(coder aDecoder: NSCoder) {
      super.init(coder: aDecoder)
      backgroundColor = UIColor.clear
   }

   public override init(frame: CGRect) {
      super.init(frame: frame)
      backgroundColor = UIColor.clear
   }

   public convenience init() {
      self.init(frame: CGRect(x: 0, y: 0, width: 20, height: 20))
      backgroundColor = UIColor.clear
   }

   /**

   /// Size of activity indicator.
   /// Default(false) size is 20x20, large size is 50x50.
   @IBInspectable public var isLarge: Bool = false {
      didSet { viewResized() }
   }

   /// Animation of activity indicator when it's shown.
   @IBInspectable public var animating: Bool = true {
      didSet { animating ? startAnimating() : stopAnimating() }
   }

   /// set `true` to `isHidden` when call `stopAnimating()`
   @IBInspectable public var hidesWhenStopped: Bool = false {
      didSet { animationLayer.isHidden = !isAnimating && hidesWhenStopped }
   }

   /// Activity indicator color style.
   public var style = KRActivityIndicatorViewStyle.gradationColor(head: .black, tail: .lightGray) {
      didSet { drawIndicatorPath() }
   }

   /// Whether view performs animation
