0

I have created a first Swift app, with a single viewController setted in the AppDelegate function:

func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {

 var tableVC:FriendsTableViewController = FriendsTableViewController(className: "Friend")
    tableVC.title = "FriendFamz"

    UINavigationBar.appearance().tintColor = UIColor(red: 0.05, green: 0.47, blue: 0.91, alpha: 1.0)
    UINavigationBar.appearance().barTintColor = UIColor(red: 0.05, green: 0.47, blue: 0.91, alpha: 1.0)
    UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName: UIColor.whiteColor()]
    UIApplication.sharedApplication().statusBarStyle = UIStatusBarStyle.LightContent


    var navigationVC:UINavigationController = UINavigationController(rootViewController: tableVC)

    let frame = UIScreen.mainScreen().bounds
    window = UIWindow(frame: frame)

    window!.rootViewController = navigationVC
    window!.makeKeyAndVisible()

Now I'd like to change the first view of the app: I'd like to create a login view (with a login ViewController), but I don't know how to create this view which would then call my FriendTableViewController...

Anyone able to help? Would be great, I've been blocked for hours... Thanks a lot

skifen128
  • 35
  • 3

1 Answers1

0

The easiest way is to go to your settings and set your initial view as that first View.

If you are using storyboard, you can just hold Control and click one View to another. Name the segue.

In your login, if it's successful do a perform segue with the Identifier. There's hundreds of tutorial on this.