Advertisement
Guest User

Untitled

a guest
May 21st, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 1.16 KB | None | 0 0
  1. //
  2. //  AppDelegate.swift
  3. //  OdnoklassnikiSwift
  4. //
  5. //  Created by Dmitry Anokhin on 20/05/2019.
  6. //  Copyright © 2019 itSimple. All rights reserved.
  7. //
  8.  
  9. import UIKit
  10.  
  11. @UIApplicationMain
  12. final class AppDelegate: UIResponder, UIApplicationDelegate {
  13.  
  14.     var window: UIWindow?
  15.  
  16.     func application(_ application: UIApplication,
  17.                      didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
  18.         OKSDK.configuration()
  19.         return true
  20.     }
  21.    
  22.     func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
  23.         OKSDK.open(url)
  24.         return true
  25.     }
  26. }
  27.  
  28. extension OKSDK {
  29.     static func configuration() {
  30.         let settings = OKSDKInitSettings()
  31.         settings.appKey = "CBAPCLDNEBABABABA"
  32.         settings.appId = "1278881280"
  33.         settings.controllerHandler = {
  34.             guard let rootViewController = UIApplication.shared.keyWindow?.rootViewController else {
  35.                 return UIViewController()
  36.             }
  37.             return rootViewController
  38.         }
  39.         OKSDK.initWith(settings)
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement