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 mainQueueA = dispatch_get_global_queue(qos_class_main(), 0) | |
let mainQueueB = dispatch_get_main_queue() | |
// This works fine | |
dispatch_apply(3, mainQueueA) { i in | |
println("A: \(i)") | |
} | |
println("Yep") | |
// This never calls the block and hangs the main thread |
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
extension NSURL { | |
func getKeyVals() -> Dictionary<String, String>? { | |
var results = [String:String]() | |
var keyValues = self.query?.componentsSeparatedByString("&") | |
if keyValues?.count > 0 { | |
for pair in keyValues! { | |
let kv = pair.componentsSeparatedByString("=") | |
if kv.count > 1 { | |
results.updateValue(kv[1], forKey: kv[0]) | |
} |