Created
August 26, 2018 06:20
-
-
Save ikhsanalatsary/b571b0cdbdc58236d6f64c6e523ccdd4 to your computer and use it in GitHub Desktop.
AppDelegate untuk React Native
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// AppDelegate.swift | |
// ReactNativeSwift | |
// | |
// Created by Gabriel Lai on 26/8/18. | |
// Copyright © 2018 Facebook. All rights reserved. | |
// | |
import UIKit | |
class AppDelegate: UIResponder, UIApplicationDelegate { | |
var window: UIWindow? | |
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool { | |
let jsCodeLocation = RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index", fallbackResource: nil) | |
let rootView = RCTRootView(bundleURL: jsCodeLocation, moduleName: "ReactNativeSwift", initialProperties: nil, launchOptions: launchOptions) | |
rootView?.backgroundColor = UIColor(red: 1.0, green: 1.0, blue: 1.0, alpha: 1) | |
window = UIWindow(frame: UIScreen.main.bounds) | |
let rootViewController = UIViewController() | |
rootViewController.view = rootView | |
window?.rootViewController = rootViewController | |
window?.makeKeyAndVisible() | |
return true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment