 import QuartzCore
 
 @IBDesignable
+
+#if !swift(>=2.3)
+private protocol CAAnimationDelegate {}
+#endif
 
 public class MarqueeLabel: UILabel, CAAnimationDelegate {
     

        }
    }
    
    public func animationDidStop(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 swift(>=2.3)
        if let presentationLayer = sublabel.layer.presentationLayer() {
            return !(presentationLayer.position.x == homeLabelFrame.origin.x)
        }
        #else
        if let presentationLayer = sublabel.layer.presentationLayer() as? CALayer {
            return !(presentationLayer.position.x == homeLabelFrame.origin.x)
        }
        #endif
        
        return false
    }
