Advertisement
Guest User

Untitled

a guest
Nov 2nd, 2015
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 0.93 KB | None | 0 0
  1. import UIKit
  2.  
  3. class ViewController: UIViewController, VKSdkDelegate {
  4.  
  5.    
  6.     var scope = [VK_PER_EMAIL]
  7.    
  8.     @IBAction func button(sender: AnyObject) {
  9.        
  10.         VKSdk.authorize(scope)
  11.        
  12.     }
  13.    
  14.    
  15.     override func viewDidLoad() {
  16.         super.viewDidLoad()
  17.        
  18.         let sdk = VKSdk.initializeWithAppId("5129688")
  19.         sdk.registerDelegate(self)
  20.  
  21.        
  22.     }
  23.  
  24.    
  25.     override func didReceiveMemoryWarning() {
  26.         super.didReceiveMemoryWarning()
  27.         // Dispose of any resources that can be recreated.
  28.     }
  29.  
  30.     func vkSdkAccessAuthorizationFinishedWithResult(result: VKAuthorizationResult!) {
  31.         print(result)
  32.         print("Hello")
  33.     }
  34.    
  35.     func vkSdkAccessTokenUpdated(newToken: VKAccessToken!, oldToken: VKAccessToken!) {
  36.         print("vkSdkAccessTokenUpdated")
  37.     }
  38.    
  39.     func vkSdkUserAuthorizationFailed(result: VKError!) {
  40.        
  41.     }
  42.  
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement