i'm trying to use MarqueeLabel
@IBOutlet weak var liveLabel: MarqueeLabel!
override func viewDidLoad() {
super.viewDidLoad()
self.liveLabelSetUp()
}
func liveLabelSetUp() {
// Continuous, with tap to pause
liveLabel.type = .continuousReverse //that's the line of the error
liveLabel.speed = .duration(10)
liveLabel.fadeLength = 10.0
liveLabel.leadingBuffer = 40.0
liveLabel.trailingBuffer = 30.0
liveLabel.isUserInteractionEnabled = true
let tapRecognizer = UITapGestureRecognizer(target: self, action: #selector(self.pauseTap))
tapRecognizer.numberOfTapsRequired = 1
tapRecognizer.numberOfTouchesRequired = 1
liveLabel.addGestureRecognizer(tapRecognizer)
}
@objc func pauseTap(_ recognizer: UIGestureRecognizer) {
let continuousLabel2 = recognizer.view as! MarqueeLabel
if recognizer.state == .ended {
continuousLabel2.isPaused ? continuousLabel2.unpauseLabel() : continuousLabel2.pauseLabel()
}
}
Error code : Thread 1: EXC_BAD_INSTRUCTION (code=1, subcode=0x0)