Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // AppDelegate.swift
- // OdnoklassnikiSwift
- //
- // Created by Dmitry Anokhin on 20/05/2019.
- // Copyright © 2019 itSimple. All rights reserved.
- //
- import UIKit
- @UIApplicationMain
- final class AppDelegate: UIResponder, UIApplicationDelegate {
- var window: UIWindow?
- func application(_ application: UIApplication,
- didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
- OKSDK.configuration()
- return true
- }
- func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
- OKSDK.open(url)
- return true
- }
- }
- extension OKSDK {
- static func configuration() {
- let settings = OKSDKInitSettings()
- settings.appKey = "CBAPCLDNEBABABABA"
- settings.appId = "1278881280"
- settings.controllerHandler = {
- guard let rootViewController = UIApplication.shared.keyWindow?.rootViewController else {
- return UIViewController()
- }
- return rootViewController
- }
- OKSDK.initWith(settings)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement