How to use MarqueeLabel in Swift?

后端 未结 7 1555
无人及你
无人及你 2021-01-05 19:17

I want to know if there\'s a way to enable horizontal scrolling of text i.e., marquee type text. I have used this library: https://github.com/cbpowell/MarqueeLabel-Swift and

7条回答
  •  臣服心动
    2021-01-05 19:37

    In Swift 4

    CODE

    UIView.animate(withDuration: 1.0, delay: 1, options: ([.curveLinear, .repeat]), animations: {() -> Void in
                self.marqueeLABEL.center = CGPoint(x: self.marqueeLABEL.bounds.size.width, y: self.marqueeLABEL.center.y)
            }, completion:  { _ in })
    

提交回复
热议问题