Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
493 views
in Technique[技术] by (71.8m points)

ios - Tab bar after login - Why does it look like this?

so I'm writing this app where I need to have a tab bar after the whole sign up/login part. I've looked around and I dont see anyone explaining me how to do this or why its happening: when I put the tab bar controller, it appears with no actual buttons, and also how should I connect the app to the tab bat controller? Either way, thats my main question. Am I missing something? Thank you! enter image description here

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

i have also been developed the application using UITabBarController faced same difficulty how to implement attach login and signup view controller.

by few work around i finally able to achieve that i don't say it is the perfect way but i am using like that,

steps make two Stroyboard 1.login.Stroyboard enter image description here

2main.Stroyboard enter image description here

3.now on homeviewcontroller.swift which is first tab of uitabbarcontroller

        override func viewDidAppear(animated: Bool) {


          guard (NSUserDefaults.standardUserDefaults().objectForKey(USER_INFO) != nil) else {//check user is logged in or not 
           //if user is not logged in present login.storyboard and do the logic there
           let storyboard = UIStoryboard(name: "Login", bundle: nil)
           let controller = storyboard.instantiateViewControllerWithIdentifier("LoginViewController") as UIViewController

           target.presentViewController(controller, animated: true, completion: nil)
            return
        }

4. in loginviewcontroller and signupviewcontroller after sucessfull login or signup dissmiss your login.storyboard

       self.dismissViewControllerAnimated(true) { () -> Void in

      }

5.here the link of project - https://drive.google.com/file/d/0B7APKZanPpc3OW92bzQ5QnRXdVU/view?usp=sharing


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...