How to use SWIFT to implement a Marquee tab in iOS

How to implement MarqueeLabel in iOS. I found an example in Objective-C, but I use Swift.
< /div>

Used to create a marquee in the swift Add Below Class in the project
https://github.com/cbpowell/MarqueeLabel-Swift/blob/master/Classes/MarqueeLabel. swift

Create the MaqQueeLabel class and add the following to your class.
Create a label and custom class in the storyboard as MarqueeLabel
Then
@IBOutlet weak var marqueeLabel: MarqueeLabel!

In ViewDidLoad
add this

marqueeLabel.type = .Continuous
marqueeLabel.scrollDuration = 5.0
marqueeLabel .animationCurve = .EaseInOut
marqueeLabel.fadeLength = 10.0
marqueeLabel.leadingBuffer = 30.0
marqueeLabel.trailingBuffer = 20.0

How to do it in iOS MarqueeLabel is implemented in Objective-C. I found an example in Objective-C, but I am using Swift.

Used to create a marquee in the swift Add Below Class in the project< br> https://github.com/cbpowell/MarqueeLabel-Swift/blob/master/Classes/MarqueeLabel.swift

Create the MaqQueeLabel class and add the following content to your class.
Create a label and custom class in the storyboard as MarqueeLabel
and then
@IBOutlet weak var marqueeLabel: MarqueeLabel!

In ViewDidLoad
add this

marqueeLabel.type = .Continuous
marqueeLabel.scrollDuration = 5.0
marqueeLabel .animationCurve = .EaseInOut
marqueeLabel.fadeLength = 10.0
marqueeLabel.leadingBuffer = 30.0
marqueeLabel.trailingBuffer = 20.0

Leave a Comment

Your email address will not be published.