[Ios] The splitViewController under the ipad makes your APP look cool !, Ipadsplitview

Source: Internet
Author: User

[Ios] The splitViewController under the ipad makes your APP look cool !, Ipadsplitview

You can use splitViewController on ipad

The splitViewController contains two viewcontrollers.

This is a way to split the screen into two parts.

In the horizontal state, two or both regions are displayed.

We usually call it

Master on the left

Detail on the right

 

How can we interact between the master and detail?

When you want to transmit information, as long as the current ViewController is under the splitViewController

You can use

Self. splitViewController. viewControllers to obtain the ViewController Array under the splitViewController.

This array uses nonatomic copy. Each time you change the controller, You need to assign a new value to the controller. [You can ignore this sentence and it is rarely used.]

This array has only two objects.

The master is located at location 0.

At location 1 is detail.

Therefore, lastObject is usually used.

And firstObject to obtain the master and detail of the current splitViewController

 

Get the corresponding master, and detail you can transmit data as you like ~~~.

 

 

========================

How to open a hidden master by clicking the toolbar button on the portrait Screen

 

First, let your strong or persistent master vc implement <splitViewControllerDeletage>

Then rewrite several methods

1 is whether to hide.

One is when hidden XXX

One is SHOW XX

 

This is because a toolBarItem object will be returned during hiding and show. This object is used to control the display of the master.

Upload this object to detail and set it to the toolbar of detail.

Note: The detail toolbar in splitVc is hidden in the horizontal state [premise: first-level subclass of the Current VC view]

The delegate method is usually used to pass this toolBarItem. Let detail implement a protocol and then. Get the detail object through splitvc.

The toolBarItem is uploaded to detail and added to the detail toolbar.

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.