iOS Swift 2 UISplitViewController opens detail screen on master's place when on iPad/ iPhone 6+
Asked Answered
A

0

1

I am having the bellow described problem with getting UISplitViewController to work on xCode 7.1.1, iOS 9.1. I have implemented the Split VC with both master and detail being a navigation controller. I have a list of tasks and then a detail task view, also a 'add new task' VC. Everything works fine on iPhone, however when I try to run on iPad (any version) or iPhone 6+/6S+, I get the following issue. Initially when I select a task from Master VC, it will load in the same Master VC with a weird grey border. Then when trying to add a new task, screen would also load in the Master VC. Any ideas what I might have done wrong? Just to clarify, I have compared my project to Apple's 'Master-Detail' template a few times and read around the internet for 2 days now... to no avail.

Here are images of what happens on iPad:

App with weird grey border when detail view is loaded within the master view

Add new item VC opening within Master VC

Maybe I am doing something wrong, or have adopted some misconception about how Split View Controller works, can anyone shed some light on this? Thank you in advance!

Aesir answered 23/11, 2015 at 10:48 Comment(2)
I'm somehow "glad" it's not only me having this issue... I couldn't find any explanation for it, if not that it's just a bug in UISplitViewController. In my case I see it happening on iPhone but only if I try to dismiss the master vc manually; by manually I mean following this workaround: #27243658 (see the first answer phatmann). It animates fine when it's dismissed by tapping on the secondary vc. I'm curious to know if you have found a solution @Aesir ThanksEuchromosome
@Euchromosome no, I didn't find an answer... and not for the lack of trying, even tried support tickets. As a friend of mine, who is a senior developer, suggested - 'it's probably designed that way with some idea that just never got documented good enough'... For this particular project, I believe at the end I just recreated the whole functionality on my own and it worked out just fine, but I wouldn't recommend such an approach for a large project.Aesir

© 2022 - 2024 — McMap. All rights reserved.