3

I'm trying to make VKSdk work with Swift. Documentation says that I need to set delegate and in order to do this I have to do the following in Objective-c

VKSdk *sdkInstance = [VKSdk initializeWithAppId:YOUR_APP_ID];
[sdkInstance registerDelegate:delegate];
[sdkInstance setUiDelegate:uiDelegate];

In swift I try to do it like this

override func viewDidLoad() {
    super.viewDidLoad()

    VKSdk.initializeWithAppId("1111111")
    VKSdk.registerDelegate(self)


}

But it says Cannot convert value of type "ViewController" to expected argument type "VKSdk"

How to do this correctly ?

Alexey K
  • 6,537
  • 18
  • 60
  • 118

1 Answers1

1

Working code below

let sdk = VKSdk.initializeWithAppId("111111")
sdk.registerDelegate(self)
Alexey K
  • 6,537
  • 18
  • 60
  • 118