Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 1.37 KB | None | 0 0
  1. import UIKit
  2. import Appodeal
  3.  
  4. @UIApplicationMain
  5. class AppDelegate: UIResponder, UIApplicationDelegate {
  6.      var appodealKey: String = "d072fa4967f7405bab0b9babfa332566e411f8a4e61b6fc2";
  7.    
  8.     var window: UIWindow?
  9.    
  10.     var isMainLayoutHide: Bool = false;
  11.  
  12.     func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
  13.        
  14.         return true
  15.     }
  16.    
  17.  
  18.  
  19.     func applicationWillResignActive(_ application: UIApplication) {
  20.         isMainLayoutHide=true;
  21.     }
  22.  
  23.     func applicationDidEnterBackground(_ application: UIApplication) {
  24.         isMainLayoutHide=true;
  25.     }
  26.  
  27.     func applicationWillEnterForeground(_ application: UIApplication) {
  28.         isMainLayoutHide=false;
  29.     }
  30.  
  31.     func applicationDidBecomeActive(_ application: UIApplication) {
  32.         let adTypes: AppodealAdType = [.interstitial, .banner, .nativeAd]
  33.         Appodeal.setTestingEnabled(false);
  34.         Appodeal.setBannerBackgroundVisible(true)
  35.         Appodeal.setSmartBannersEnabled(true)
  36.         Appodeal.setLogLevel(APDLogLevel.verbose);
  37.        
  38.         Appodeal.initialize(withApiKey: appodealKey, types:  adTypes);
  39.  
  40.         isMainLayoutHide=false;
  41.  
  42.     }
  43.  
  44.     func applicationWillTerminate(_ application: UIApplication) {
  45.    
  46.         isMainLayoutHide=true;
  47.  
  48.     }
  49.  
  50.  
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement