objective-cswiftvk-sdk

I am trying to convert the following objective-c code to swift:


    SVKShareDialogController * shareDialog = [VKShareDialogController new];
    shareDialog.text = @"Your share text here";
    shareDialog.otherAttachmentsStrings = @[@"https://vk.com/dev/ios_sdk"];
    [shareDialog presentIn:self];

//SWIFT
    var shareDialog = VKShareDialogController()
    shareDialog.text = "Your share text here"
    shareDialog.otherAttachmentsStrings = ["https://vk.com/dev/ios_sdk"]

But I get some errors saying that type "viewcontroller" does not conform to protocol "VKSdkDelegate".

How can I fix this issue?


Solution

  • The error is because you are adopting the VKSdkDelegate protocol in your ViewController class, but you have not implemented one or more of the required methods. The VKSdkDelegate reference lists all required methods that you have to implement in your class.