     ///   - image: Button image.
     ///   - highlightedImage: Button highlighted image.
     ///   - fadeDuration: Fade duration.
-    public init(frame: CGRect, image: UIImage, highlightedImage: UIImage, fadeDuration: Float) {
+    public init(frame: CGRect, image: UIImage, highlightedImage: UIImage, fadeDuration: TimeInterval) {
         self.fadeDuration = fadeDuration
         
         super.init(frame: frame)

    public required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        
        self.fadeDuration = aDecoder.decodeFloat(forKey: "FadeDuration")
        self.overlayImageView = aDecoder.decodeObject(forKey: "OverlayImageView") as! UIImageView // swiftlint:disable:this force_cast
        self.overlayImageView.frame = self.imageView!.frame
        self.overlayImageView.bounds = self.imageView!.bounds

                self.addSubview(self.overlayImageView)
                self.overlayImageView.alpha = 0
                
                UIView.animate(withDuration: self.fadeDuration, animations: {
                    self.overlayImageView.alpha = 1
                })
            } else {
                UIView.animate(withDuration: self.fadeDuration, animations: {
                    self.overlayImageView.alpha = 0
                    }, completion: { completed in
                        if completed {
                            self.overlayImageView.removeFromSuperview()
                        }
