swift - How to repeat flip animation? -


i'm trying create own activity indicator view twitch chat activity indicator view. i've tried use animate .repeat:

override func animate() {     uiview.animate(withduration: 1, delay: 0, usingspringwithdamping: 1, initialspringvelocity: 1, options: [.repeat, .transitionflipfromleft], animations: {         self.flip()     }, completion: nil) } 

and timer

let timer = timer.init(timeinterval: 2, target: self, selector: #selector(flip), userinfo: nil, repeats: true) 

here flip() function

func flip() {     self.isflipped = !self.isflipped      let fromview = self.isflipped ? self.view1 : self.view2     let toview = self.isflipped ? self.view2 : self.view1      uiview.transition(from: fromview, to: toview, duration: 1, options: [.transitionflipfromtop, .showhidetransitionviews], completion: nil) } 

but did not work. don't know missed. can guys me please?


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -