SCS
SCS

Reputation: 435

On Blinking button it goes to a light shade

enter image description here

click a add button in the same page of the blinking button page to select a name from a new page and back to the blinking button page the blinking button is not blinking and is in a light shade.

    self.checkAvalibilityBtn.alpha = 1.0
    UIView.animate(withDuration: 0.80, delay: 0.0, options: [.curveEaseIn, .repeat, .autoreverse, .allowUserInteraction], animations: {() -> Void in
        self.checkAvalibilityBtn.alpha = 0.2
    }, completion: {(finished: Bool) -> Void in
    })

Upvotes: 1

Views: 39

Answers (1)

Amir Khan
Amir Khan

Reputation: 1318

You are almost done. Need to reset alpha to 1 in completion block -

    self.checkAvalibilityBtn.alpha = 1.0
    UIView.animate(withDuration: 0.80, delay: 0.0, options: [.curveEaseIn, .repeat, .autoreverse, .allowUserInteraction], animations: {() -> Void in
        self.checkAvalibilityBtn.alpha = 0.2
    }, completion: {(finished: Bool) -> Void in
        self.checkAvalibilityBtn.alpha = 1.0
    })

Upvotes: 2

Related Questions