Skip to content

Instantly share code, notes, and snippets.

@jamesktan
Created November 30, 2015 18:23
Show Gist options
  • Save jamesktan/a66ee52a9b352d98d075 to your computer and use it in GitHub Desktop.
Save jamesktan/a66ee52a9b352d98d075 to your computer and use it in GitHub Desktop.
Extension function for Swift Strings that will accept a NSMutableArray argument
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