0

I have a UISplitViewController. When run in compact mode the detail views are "pushed" onto the navigation stack like pages (with the back button in the navigation bar).

I would like to simply change the page transition animation from a push from the side, to a modal style animation: i.e., have the detail view slide in up from the bottom. But only have it animate as a modal when the UISplitViewController is in compact mode (running on smaller devices - i.e., iPhones, etc).

An image for context:

enter image description here

As you can see, this is a normal page transition, but I would like the detail to slide up like a "page sheet" transition if possible.

I've tried modifying the segue in Main.storyboard however that changes the transition even for regular sizes (i.e., iPads, etc) which makes an additional detail view slide over the side-by-side view that's seen on regular sized devices.

Any help is appreciated!

1 Answers1

0

Although it is doable, I would highly recommend against it. If you still want to go ahead with it, the simplest way would be to create two identical viewControllers with two different segues and segue types. Then you can make a check on device idiom and call the relevant segue. Again, I would not recommend such an approach

Malik
  • 3,763
  • 1
  • 22
  • 35
  • Do you have any particular reasons why you don't recommend such an approach? – Aᴄʜᴇʀᴏɴғᴀɪʟ May 15 '17 at 05:23
  • 1
    For starters, you might end up losing information (or will have to manually pass the information to the child view controller) which would be sent through if you were to use the default functionality. Secondly, you would be creating two identical view controllers. In addition to taking up space, you will be prone to inconsistency. Lastly, it might be against apple's guidelines – Malik May 15 '17 at 05:28
  • Good points! I first saw this functionality in the [Day One](https://itunes.apple.com/au/app/day-one-journal/id1044867788?mt=8) app. On smaller devices the detail slides up. Can't be sure how they did it though - they may even use a custom non-Apple `SplitViewController`... – Aᴄʜᴇʀᴏɴғᴀɪʟ May 15 '17 at 05:36