Swift Foundation Uitabbarcontroller (this was added directly in the previous uitableview)

Source: Internet
Author: User

These basic content basically already can build the project frame, the rest is some optimization, detail and data request question, slowly update ....

To create a method in Appdelegate

Create method Execution Uitabbarcontroller

Func Createtabbar ()
{
Let Tabbarcontro = Uitabbarcontroller ();

Let VIEWC = Viewcontroller ();
ViewC.tabBarItem.image = UIImage (named: "Item1.png");
Let onenavigation = Uinavigationcontroller.init (ROOTVIEWCONTROLLER:VIEWC);

Let FIRSTVC = Firstviewcontroller ();
FirstVC.tabBarItem.image = UIImage (named: "Item2.png");
Let twonavigation = Uinavigationcontroller.init (ROOTVIEWCONTROLLER:FIRSTVC);

Let SECONDVC = Secondviewcontroller ();
SecondVC.tabBarItem.image = UIImage (named: "Item3.png");
Let threenavigation = Uinavigationcontroller.init (ROOTVIEWCONTROLLER:SECONDVC);

Let Navarray = [onenavigation,twonavigation,threenavigation];
Tabbarcontro.viewcontrollers = Navarray;

Window?. Rootviewcontroller = Tabbarcontro;

}

Click on the first module to enter the second layer to hide Tabbar

Enter the second layer of the interface to hide Uitabbarcontroller

Override func Viewwillappear (Animated:bool) {
Navigationcontroller?. Tabbarcontroller?. Tabbar.hidden = true;
}
Override func Viewwilldisappear (Animated:bool) {
Navigationcontroller?. Tabbarcontroller?. Tabbar.hidden = false;
}

Swift Foundation Uitabbarcontroller (this was added directly in the previous uitableview)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.