 
 extension String {
     subscript (i: Int) -> Character {
-        return self[advance(self.startIndex, i)]
+        return self[self.startIndex.advancedBy(i)]
     }
     
     subscript (i: Int) -> String {

    }
    
    subscript (r: Range<Int>) -> String {
        return substringWithRange(Range(start: advance(self.startIndex, r.startIndex), end: advance(self.startIndex, r.endIndex)))
    }
}

struct TKSwipeData {
    let swipeData: String
    
    var cardHolder: String {
        get {
            var cardHolder = swipeData.componentsSeparatedByString("^")[1]
            var cardHolderParts = cardHolder.componentsSeparatedByString("/")
            return "\(cardHolderParts[1]) \(cardHolderParts[0])"
        }
    }
    
    var cardNumber: String {
        get {
            var charIndex = swipeData.rangeOfString("^")!
            var sIndex = advance(swipeData.startIndex, 2)
            var eIndex = advance(charIndex.endIndex, -1)
            return swipeData.substringWithRange(sIndex..<eIndex)
        }
    }
    
    var cardLastFour: String {
        get {
            var eIndex = advance(cardNumber.endIndex, -4)
            return cardNumber.substringFromIndex(eIndex)
        }
    }
    
    var cardExpiration: String {
        get {
            var expParts = swipeData.componentsSeparatedByString("^")[2]
            return "\(expParts[2..<4])\(expParts[0..<2])"
        }
    }

    }
    
    func maskedCardNumber(mask: String = "X") -> String {
        let eIndex = cardNumber.endIndex.advancedBy(-4)
        var maskCharacters = ""
        
        for _ in 0..<cardNumber.substringToIndex(eIndex).characters.count {
            maskCharacters = maskCharacters + mask
        }
        
