         /**
          *  Font for title text in loader
          */
-        public var titleTextFont : UIFont = UIFont.boldSystemFontOfSize(16.0)
+        public var titleTextFont : UIFont = UIFont.boldSystemFont(ofSize: 16.0)
         
         /**
          *  Background color for loader
          */
-        public var backgroundColor = UIColor.whiteColor()
+        public var backgroundColor = UIColor.white
         
         /**
          *  Foreground color
          */
-        public var foregroundColor = UIColor.clearColor()
+        public var foregroundColor = UIColor.clear
         
         /**
          *  Foreground alpha CGFloat, between 0.0 and 1.0

        private var backgroundLayer : CAShapeLayer?
        private var isSpinning : Bool?
        
        private var config : Config = Config() {
            didSet {
                self.update()
            }

    private func stop() {
        
        if (self.animated) {
            UIView.animate(withDuration: 0.3, animations: { () -> Void in
                self.alpha = 0
            }, completion: { (finished) -> Void in
                self.removeFromSuperview()
                self.coverView?.removeFromSuperview()
                self.loadingView?.stop()
            });
        } else {
            self.alpha = 0
