I can not log in to VKontakte. There is no documentation on Swift in VKontakte, only on objective-c. I tried to do this:

Connected VKSdk.framework. In the AppDelegate registered openurl:

func application(application: UIApplication, openURL url: NSURL, sourceApplication: NSString?, annotation: AnyObject) -> Bool { var wasHandled:Bool = VKSdk.processOpenURL(url, fromApplication: sourceApplication) return wasHandled } 

In class:

 import UIKit class ViewController: UIViewController { var viewController: UIViewController? let SCOPE = [ "friends" ]; override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. VKSdk.initializeWithDelegate(self, andAppId: "4727261") if (VKSdk.wakeUpSession()) { } else { VKSdk.authorize(SCOPE); } } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } } 

Swears at the line:

 VKSdk.initializeWithDelegate(self, andAppId: "4727261") 

Who faced, tell me what to send.

    1 answer 1

    Swears on / BLABLABLA / swift: 297: 33: Type 'classname' does not conform to protocol 'VKSdkDelegate' ?

    If yes, then add protocol support to the class where the whole thing happens:

     extension MyClass: VKSdkDelegate { func vkSdkNeedCaptchaEnter(captchaError: VKError) { } func vkSdkTokenHasExpired(expiredToken: VKAccessToken) { } func vkSdkUserDeniedAccess(authorizationError: VKError) { } func vkSdkShouldPresentViewController(controller: UIViewController) { } func vkSdkReceivedNewToken(newToken: VKAccessToken) { } }