class AsyncOperation : NSOperation {
override func main () {
print("In the user queue")
NSOperationQueue.mainQueue().addOperationWithBlock({
print("main block")
})
}
}
let queue = NSOperationQueue()
let operation = AsyncOperation();
queue.addOperation(operation)
it prints In the user queue
but does not print main block
. Since I am adding to the main queue I expect it to get executed. Do i have to start the queue execution ??