I have a UILabel with background color as grey.
I want a blinking effect on this label like it should become a little white & then become gray and it should keep happen till I turn it off programatically.
Any clue how to achieve this?
I have a UILabel with background color as grey.
I want a blinking effect on this label like it should become a little white & then become gray and it should keep happen till I turn it off programatically.
Any clue how to achieve this?
Here is my solution in Swift 4.0 with extension for any UIVIew
Tweaking Krishnabhadra Answer to give a better blink effect
Declare a Class variable
bool blinkStatus;
And paste code given below
}
A different approch but works. Blinking only for 3 seconds
This is how it worked for me. I adapted the answer of @flex_elektro_deimling
First parameter UIView.animateWithDuration is the total time of the animation (In my case I've set it to 0.5), you may set different values on the first and second (delay) to change the blinking speed.
Got stuck when trying with swift and using multiple options but this seems to work nicely: