Closed yurii-voievodin closed 4 years ago
Thank you. I'll add a test case for this today.
@lexrus And one important thing. On Simulator everything is OK. Lags appears only on device.
@yura-voevodin Please check out the master branch. I just updated the demo with a progress control. And increased the total frame count. Could you also give the numbers of morphingDuration
and morphingCharacterDelay
so that I can reproduce the issue on my iPhone.
Same issue. Video: https://drive.google.com/file/d/1pq7Tven49KUxgjgdLAGCGrxjsEJl_Nay/view?usp=drivesdk
You may download my app and see that issue: https://itunes.apple.com/us/app/repost-for-instagram-quick-ig/id1445207836
My code:
import UIKit
import StoreKit
import LTMorphingLabel
class InAppVC: UIViewController {
@IBOutlet weak var morphLabel: LTMorphingLabel!
// Morph label logic
var timer: Timer?
var morphTexts = [NSLocalizedString("morph_1", comment: ""), NSLocalizedString("morph_2", comment: ""), NSLocalizedString("morph_3", comment: ""), NSLocalizedString("morph_4", comment: ""), NSLocalizedString("morph_5", comment: ""), NSLocalizedString("morph_6", comment: ""), NSLocalizedString("morph_7", comment: "")]
var morphTextIndex = 0
// MARK: - INIT -
deinit {
killTimer()
}
// MARK: - VIEW LIFECYCLE -
override func viewDidLoad() {
super.viewDidLoad()
if KeychainStore.isInAppBuyed {
morphTexts.append("❤️")
}
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
if self.timer == nil {
setTimer()
}
}
// MARK: - TIMER -
func setTimer() {
self.morphLabel.morphingEffect = .anvil
self.timer = Timer.scheduledTimer(timeInterval: 1.5, target: self, selector: #selector(fire), userInfo: nil, repeats: true)
}
func killTimer() {
timer?.invalidate()
timer = nil
}
@objc private func fire() {
if morphTextIndex >= morphTexts.count {
morphTextIndex = 0
}
morphLabel.text = morphTexts[morphTextIndex]
morphTextIndex += 1
}
}
I updated to latest commit and the problem is solved. Thank you!
pod 'LTMorphingLabel', :git => 'https://github.com/lexrus/LTMorphingLabel.git', :commit => '757ed4c'
@lexrus Works fine on the latest commit! I'm using morphingDuration = 0.7
and morphingCharacterDelay
with default value.
Would be nice if you did a Cocoapods release with the lag fix, Thanks
Lags in the animation on the latest version 0.6.0.
And on 0.5.9 version of the library everything was ok.
My class
AnimatedLabel
added via Storyboard.