Created
November 30, 2015 18:23
-
-
Save jamesktan/a66ee52a9b352d98d075 to your computer and use it in GitHub Desktop.
Extension function for Swift Strings that will accept a NSMutableArray argument
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static func withFormat(format: String, list:NSMutableArray) -> String { | |
if list.count > 0 { | |
let path = String(format: format, list.firstObject as! String) | |
list.removeObject(list.firstObject!) | |
return self.withFormat(path, list: list) | |
} else { | |
return format | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment