         }
     }
     
+    #if swift(>=2.3)
     public func animationDidStop(anim: CAAnimation, finished flag: Bool) {
+        scrollDidStop(anim, finished: flag)
+    }
+    #else
+    override public func animationDidStop(anim: CAAnimation, finished flag: Bool) {
+        scrollDidStop(anim, finished: flag)
+    }
+    #endif
+    
+    private func scrollDidStop(anim: CAAnimation, finished flag: Bool) {
         if let setupAnim = anim as? GradientSetupAnimation {
             if let finalColors = setupAnim.toValue as? [CGColorRef] {
                 maskLayer?.colors = finalColors

     The "home" location is the traditional location of `UILabel` text. This property essentially reflects if a scroll animation is underway.
     */
    public var awayFromHome: Bool {
        if let presentationLayer = sublabel.layer.presentationLayer() {
            return !(presentationLayer.position.x == homeLabelFrame.origin.x)
        }
        
        return false
    }

import QuartzCore

@IBDesignable

#if !swift(>=2.3)
private protocol CAAnimationDelegate {}
#endif

public class MarqueeLabel: UILabel, CAAnimationDelegate {
    
