Giter Site home page Giter Site logo

tabsandsplits's Introduction

TabsAndSplits

A demonstration of two UISplitViewControllers as children of a UITabBarController

On the iPad simulator in landscape, the two tabs provide the following arrangement of views (as expected).

Note: The double-arrow button in the top left corner of the detail view is the UISplitViewController -displayModeButtonItem.

In landscape the UISplitViewController's preferredDisplayMode property is set to

self.preferredDisplayMode = UISplitViewControllerDisplayModeAllVisible;

Using - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator we are watching to see when we switch from landscape to portrait. When detected we change the UISplitViewController's preferredDisplayMode property to

self.preferredDisplayMode = UISplitViewControllerDisplayModePrimaryHidden;

This results in the following arrangement of views (as expected).

Note: The back (<) button in the top left corner of the detail view is the UISplitViewController -displayModeButtonItem. Tapping this button will, using animation, change the UISplitViewController's preferredDisplayMode property to UISplitViewControllerDisplayModePrimaryOverlay.

Using this sample app in portrait mode, it is desirable that on tapping the back (<) button in the top left corner in the detail view that the master view should be displayed as an overlay. However, the overlay appears "above" the UITabBar as seen below:

There does not appear to be a way to display the overlay in such a fashion as it is under the tab bar, but an overlay of the detail view. The appearance of the master view over top of the tab bar seems like a violation of the implied view hierarchy.

It was expected, given the arrangement of a UISplitViewController inside a UITabBarController, that the overlay master view controller would be displayed under the tab bar but over the detail view, as see in the following mockup:

It should be noted that the iOS 7 documentation specifically states that

A split view controller must always be the root of any interface you create. In other words, you must always install the view from a UISplitViewController object as the root view of your application’s window. The panes of your split view interface may then contain navigation controllers, tab bar controllers, or any other type of view controller you need to implement your interface.

https://developer.apple.com/library/ios/documentation/WindowsViews/Conceptual/ViewControllerCatalog/Chapters/SplitViewControllers.html

Despite this statement, however, it appears that several of Apple's own iPad apps are breaking the recommended convention. (The UISplitViewControllerDisplayModePrimaryOverlay option is only available in iOS8.)

Podcasts

iTunes U

WWDC

tabsandsplits's People

Stargazers

Kenneth James Uy avatar Lim, ChaeMyeong avatar  avatar  avatar Sergey Vetrogonov avatar Vladislav Prusakov avatar Christian Treffs avatar Ben Winters avatar  avatar Luka avatar Bart Vandendriessche avatar  avatar Vanderlei Martinelli avatar  avatar Alena Belyaeva avatar Bob Edmonston avatar denkeni avatar Libe avatar  avatar Jonathan Sibley avatar  avatar Wouter van den Broek avatar

Watchers

 avatar James Cloos avatar Dave Anderson avatar  avatar

Forkers

zhjuncai

tabsandsplits's Issues

WWWDC and iTunes U Apps

I saw that you posted photos of the WWDC and iTunes U apps. Do you have an example, or do you happen to know how the single nav bar is accomplished for a UISplitViewController in a UITabbarController?

Confusion with iPhone 6 Plus

I am currently making an app that requieres an interface like that, thanks to this code i was able to show the master view even in portrait orientation on iPad, but when i launch it in iPhone 6 Plus, it is supposed to show both master and detail in landscape orientation but it still shows only one view, why this happens?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.