             return
         }
 
-        var i = 0
-        for char in text.characters {
+        var contentLayersIndex = contentLayers.startIndex
+        var charactersIndex = text.characters.startIndex
+        
+        while charactersIndex < text.characters.endIndex {
+            let char = text.characters[charactersIndex]
             if let _ = Int(String(char)) {
-                let scrollLayer = contentLayers[i]
+                let scrollLayer = contentLayers[contentLayersIndex]
                 let contentsLayer = scrollLayer.sublayers![0]
 
                 #if os(OSX)

                boundingSize.height = max(boundingSize.height, scrollLayer.bounds.height)
            } else {
                let charLayer:CALayer

                if currentLayer?.valueForKey("myContents") as? String == String(char) {
                    charLayer = currentLayer!
                    charLayer.removeAllAnimations()
                    charLayer.frame.origin = currentOrigin

    private var _digitsImage:TRZImage?
    public var digitsImage:TRZImage! {
        if (_digitsImage == nil) {
            _digitsImage = createDigitsImage(self.font)
        }
        return _digitsImage
    }
