This file contains 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
import Foundation | |
extension String { | |
func isMatch(regexp:Regexp) -> Bool { | |
let range = NSMakeRange(0, self.characters.count) | |
let matches = regexp.internalRegexp.matchesInString(self, options: [], range:range ) | |
return matches.count > 0 | |
} | |
func matches(regexp:Regexp) -> [String]? { |
This file contains 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
#!/usr/bin/env xcrun --sdk macosx swift | |
import Foundation | |
let version = "1.1" | |
var debug = false | |
// MARK: Exit status code | |
enum ExitCode: Int32 { | |
case success = 0 |
This file contains 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
let record = CKRecord(recordType: "MyType", recordID: recordID) | |
record["title"] = "name" as CKRecordValue? | |
record["price"]= 1 as CKRecordValue? |