lexrus / LTMorphingLabel

[EXPERIMENTAL] Graceful morphing effects for UILabel written in Swift.
MIT License
8.07k stars 782 forks source link

New Bug from installing Xcode 7.3 #53

Closed mhlangagc closed 8 years ago

mhlangagc commented 8 years ago

... Error in the LTMorphingLabel.swift file on installing Xcode 7.3.

On the line : (if previousText != text && currentFrame++...) and ( if ++skipFramesCount > closure() {...) There is the error '++ is deprecated and will be removed in Swift 3. I don't know how yet, but these lines will need an update. .

// MARK: - Animation extension
extension LTMorphingLabel {

    func displayFrameTick() {
        if displayLink.duration > 0.0 && totalFrames == 0 {
            let frameRate = Float(displayLink.duration) / Float(displayLink.frameInterval)
            totalFrames = Int(ceil(morphingDuration / frameRate))

            let totalDelay = Float((text!).characters.count) * morphingCharacterDelay
            totalDelayFrames = Int(ceil(totalDelay / frameRate))
        }

        if previousText != text && currentFrame++ < totalFrames + totalDelayFrames + 5 {
            morphingProgress += 1.0 / Float(totalFrames)

            if let closure = skipFramesClosures[
                "\(morphingEffect.description)\(phaseSkipFrames)"
                ] {
                    if ++skipFramesCount > closure() {
                        skipFramesCount = 0
                        setNeedsDisplay()
                    }
            } else {
                setNeedsDisplay()
            }

            if let onProgress = delegate?.morphingOnProgress {
                onProgress(self, morphingProgress)
            }
        } else {
            displayLink.paused = true

            delegate?.morphingDidComplete?(self)
        }
    }
lexrus commented 8 years ago

Yes, I knew it. Thanks.

lexrus commented 8 years ago

This was fixed in b312cbdd33ea35b5c0117d20738ae57a61779db0