ios - How do I apply an animation around a button? -


i have 30 sec of song being played when play button being played. want progress bar go around play button song being played. how this?

play = add[indexpath.row]     let playbutton : uibutton = uibutton.buttonwithtype(uibuttontype.custom) as! uibutton     playbutton.tag = indexpath.row     let imageret = "playbutton"     playbutton.setimage(uiimage(named: imageret), forstate: .normal)     playbutton.frame = cgrectmake(236, 20, 100, 100)     playbutton.addtarget(self,action: "playit:", forcontrolevents: uicontrolevents.touchupinside) 

i'm assuming want this:

enter image description here

it cashapelayer path circle. start strokeend of 0 , animate 1. can poll song's progress using nstimer at, say, 1-second intervals , calculate how of song has played, , set strokeend fraction.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -