Alfi Alfi - 1 year ago 413
Swift Question

how Marquee text of label on swift?

I want to create a marquee label in Swift. I tried some codes but could not get it to work.

I also can do this with animation but I have problem with repeating it.

I tried this too

any help will be appreciated.

Answer Source

I Founded even Much Better Solution !

I Combined 2 Different method together

here with this code in swift you can do Marquee with ultimate repeat and very simple ! Just put Your Label Out side of Display View.

 UIView.animateWithDuration(8.0, delay:0, options: [.Repeat], animations: {   
        self.YOURLABELNAME.frame = CGRectMake(self.YOURLABELNAME.frame.origin.x - 500, self.YOURLABELNAME.frame.origin.y - 0, self.YOURLABELNAME.frame.size.width, self.YOURLABELNAME.frame.size.height)
        }, completion: nil)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download