Invincible Acquisition Controller

Source: Internet
Author: User

SWIF:

Let tabbarcontroller: uitabbarcontroller = uiapplication. Sharedapplication(). Keywindow?. Rootviewcontroller as ! uitabbarcontroller

let nav: uinavigationcontroller = Tabbarcontroller. Selectedviewcontroller as ! uinavigationcontroller

Then you can push it out.

Nav.Pushviewcontroller(VC, Animated: true)

You can use it when you have too many layers of view in your case, or if you can't get it in a xib situation.

Oh, you can get the tab you want.

Let tabbarcontroller = uiapplication. Sharedapplication(). Keywindow?. rootviewcontroller

let nav = Tabbarcontroller?. childviewcontrollers

Let home:uinavigationcontroller = nav![ 0] as! uinavigationcontroller

Oc:

Uitabbarcontroller *tabbarcontroller = (uitabbarcontroller *)self. Window. Rootviewcontroller;

Uinavigationcontroller * nav = Tabbarcontroller. Selectedviewcontroller;

uiviewcontroller *viewcontroller = nav.viewcontrollers[0];

Invincible Acquisition Controller

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.