maail / MMSlidingButton

Create a slide to unlock button in Swift using Storyboard
MIT License
98 stars 35 forks source link

Add Shimmer Effect #5

Open otymartin opened 7 years ago

otymartin commented 7 years ago

@maail fullsizerender It would be cool to integrate the Facebook Shimmer effect here. It helps hint the user to slide the button when the button has one color. The Arrow I found is not enough. I managed do it for the "ButtonText" and it works great. I personally don't know how to do PR's or add to project so if you could this would be great.


if !self.buttonText.isEmpty{

            self.buttonLabel               = UILabel(frame: CGRect(x: 0, y: 0, width: self.frame.size.width, height: self.frame.size.height))
            self.buttonLabel.textAlignment = .center
            self.buttonLabel.text          = buttonText
            self.buttonLabel.textColor     = UIColor.white
            self.buttonLabel.font          = self.buttonFont
            self.buttonLabel.textColor     = self.buttonTextColor
            //self.addSubview(self.buttonLabel)

            //Add Shimmer Effect
            let shimmerView = FBShimmeringView(frame: CGRect(x: 0, y: 0, w: self.frame.size.width, h: self.frame.size.height))
            shimmerView.contentView = self.buttonLabel
            shimmerView.shimmeringDirection = .right
            shimmerView.shimmeringOpacity = 0.3
            shimmerView.shimmeringSpeed = 175
            shimmerView.shimmeringPauseDuration = 0.2
            shimmerView.shimmeringAnimationOpacity = 1
            shimmerView.shimmeringHighlightLength = 0.33
            shimmerView.isShimmering = true
            self.addSubview(shimmerView)

            self.dragPointButtonLabel               = UILabel(frame: CGRect(x: 0, y: 0, width: self.frame.size.width, height: self.frame.size.height))
            self.dragPointButtonLabel.textAlignment = .center
            self.dragPointButtonLabel.text          = buttonText
            self.dragPointButtonLabel.textColor     = UIColor.white
            self.dragPointButtonLabel.font          = self.buttonFont
            self.dragPointButtonLabel.textColor     = self.dragPointTextColor
            self.dragPoint.addSubview(self.dragPointButtonLabel)
        }
otymartin commented 7 years ago

But not hide or remove button.So Please help me. dont understand the question, whats wrong?