IPhone : iOS-How to use NSOperationQueue in Swift

on Friday, March 27, 2015

I'm using NSOperationQueue in my app,I write it with Objective C.And I'm currently converting my app to Swift.I wonder how can I use NSOperationQueue in Swift?


Here is my code on objective c



-(NSOperationQueue*)operationQueue
{
if(_operationQueue == nil) {
_operationQueue = [NSOperationQueue new];
}
return _operationQueue;
}


And I already tried in swift



func operationQueue() -> NSOperationQueue{

if(_operationQueue == nil){

_operationQueue = NSOperationQueue.new()

}


But it gives me error " NSOperationQueue is not convertible to 'MirrorDispotion'"


0 comments:

Post a Comment