     init (_ f: T) { self.f = f }
 }
 
+private struct Scroller {
+    typealias Scroll = (layer: CALayer, anim: CAKeyframeAnimation)
+    
+    init(generator gen: (interval: CGFloat, delay: CGFloat) -> [Scroll], scrolls: [Scroll]? = nil) {
+        self.generator = gen
+    }
+    
+    let generator: (interval: CGFloat, delay: CGFloat) -> [Scroll]
+    var scrolls: [Scroll]? = nil
+    
+    mutating func generate(interval: CGFloat, delay: CGFloat) -> [Scroll] {
+        if let existing = scrolls {
+            return existing
+        } else {
+            scrolls = generator(interval: interval, delay: delay)
+            return scrolls!
+        }
+    }
+}
+
 private extension UIResponder {
     // Thanks to Phil M
     // http://stackoverflow.com/questions/1340434/get-to-uiviewcontroller-from-uiview-on-iphone

    // Define animation completion closure type
    private typealias MLAnimationCompletion = (finished: Bool) -> ()
    
    private func scroll(interval: CGFloat,
        delay: CGFloat = 0.0,
        scroller: (interval: CGFloat, delay: CGFloat) -> [(layer: CALayer, anim: CAKeyframeAnimation)],
        callback: MarqueeLabel -> (interval: CGFloat, delay: CGFloat) -> ())
    {
        
        // Check for conditions which would prevent scrolling
        if !labelReadyForScroll() {
            return

        CATransaction.setAnimationDuration(transDuration)
        
        // Create gradient animation, if needed
        var gradientAnimation: CAKeyframeAnimation? = nil
        if fadeLength > 0.0 {
            // Remove any setup animation, but apply final values
            if let finalColors = self.layer.mask?.animationForKey("setupFade")?.valueForKey("setupFade") as? [CGColorRef] {
                let gradientMask = self.layer.mask as? CAGradientLayer
                gradientMask?.colors = finalColors
            }
            self.layer.mask?.removeAnimationForKey("setupFade")
            
            // Generate animation if needed
            gradientAnimation = {
                if let previousAnimation = fader {
                    return previousAnimation
                } else {
                    return keyFrameAnimationForGradient(fadeLength, interval: interval, delay: delay)
                }
            }()
            
            // Apply scrolling animation
            self.layer.mask?.addAnimation(gradientAnimation!, forKey: "gradient")
        }
        
        let completion = CompletionBlock<MLAnimationCompletion>({ (finished: Bool) -> () in
