I'm trying to convert this to swift:
+ (instancetype)sharedGameKitHelper
{
static GameKitHelper *sharedGameKitHelper;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedGameKitHelper = [[GameKitHelper alloc] init];
});
return sharedGameKitHelper;
}
now I dont have any experience with Objective-C so I used this converter: Objectivec2swift.com and it gave me this:
class func sharedGameKitHelper() -> Self {
var sharedGameKitHelper: GameKitHelper?
var onceToken: dispatch_once_t
dispatch_once(onceToken, {() -> Void in
sharedGameKitHelper = GameKitHelper()
})
return sharedGameKitHelper!
}
It gives me some error, and I have no clue what to do with it, so I would appreciate a bit of help here.
Errors: