在UISplitViewController和其他视图控制器之间切换的最佳方法是什么? [英] Best way to switch between UISplitViewController and other view controllers?

查看:102
本文介绍了在UISplitViewController和其他视图控制器之间切换的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创作一款iPad应用。应用程序中的一个屏幕非常适合使用UISplitViewController。但是,应用程序的顶级是一个主菜单,我不想使用UISplitViewController。这提出了一个问题,因为Apple声明:


  1. UISplitViewController 应该是应用程序中的顶级视图控制器,即其视图应添加为 UIWindow


  2. <的子视图p>如果使用, UISplitViewController 应该在应用程序的生命周期中存在 - 即不要从UIWindow中移除其视图并将其他视图放在适当位置,反之亦然


阅读并进行实验后,似乎只有满足Apple要求的可行选项,而我们自己的选择是使用模态对话框。所以我们的应用程序在根级别有一个UISplitViewController(即它的视图被添加为UIWindow的子视图),为了显示我们的主菜单,我们将它作为全屏模式对话框推送到UISplitViewController上。然后通过关闭主菜单视图控制器模式对话框,我们实际上可以显示我们的拆分视图。



这个策略似乎工作正常。但是它引出了一些问题:



1)有没有更好的方法来构建这个,没有模态,也符合提到的所有要求?由于被推送为模态对话框,主UI出现似乎有点奇怪。 (模式应该用于专注的用户任务。)



2)由于我的方法,我是否有遭受应用商店拒绝的风险?根据Apple的人机界面指南,这种模式策略可能是误用模态对话框。但是他们给了我什么其他选择呢?无论如何,他们会知道我这样做吗?

解决方案

Touche!进入相同的问题并使用模态以相同的方式解决它。在我的情况下,它是一个登录视图,然后主菜单也在splitview之前显示。我使用了你想到的相同策略。我(以及我采访过的其他几位知识渊博的iOS人员)找不到更好的出路。对我来说很好。无论如何,用户从不注意到模态。如此表达他们。是的,我也可以告诉你,有很多应用程序在App商店的引擎技巧下做同样的事情。 :)另一方面,请告诉我,如果你在某个时候以某种方式想出更好的出路:)


I'm authoring an iPad app. One of the screens in the app is perfectly suited to using a UISplitViewController. However, the top level of the app is a main menu, which I don't want to use a UISplitViewController for. This presents a problem, because Apple state that:

  1. UISplitViewController should be the top level view controller in the app, i.e. its view should be added as the subview of UIWindow

  2. if used, UISplitViewController should be there for the lifetime of the app -- i.e. don't remove its view from UIWindow and put another in place, or vice versa

Having read around and experimented, it seems to only viable option to satisfy Apple's requirements and our own is to use modal dialogs. So our app has a UISplitViewController at the root level (i.e. its view added as the subview of UIWindow), and to show our main menu, we push it as a full-screen modal dialog onto the UISplitViewController. Then by dismissing the main menu view controller modal dialog, we can actually show our split view.

This strategy seems to work fine. But it begs the questions:

1) Is there any better way of structuring this, without modals, that also meets all the requirements mentioned? It seems a bit odd having the main UI appear by virtue of being pushed as a modal dialog. (Modals are supposed to be for focused user tasks.)

2) Am I at risk of app store rejection because of my approach? This modal strategy is probably 'misusing' modal dialogs, as per Apple's human interface guidelines. But what other choice have they given me? Would they know that I'm doing this, anyway?

解决方案

Touche! Ran in to the same issue and solved it the same way using modals. In my case it was a login view and then the main menu as well to be shown before the splitview. I used the same strategy as thought out by you. I (as well as several other knowledgeable iOS folks I spoke to) could not find a better way out. Works fine for me. User never notices the modal anyway. Present them so. And yes I can also tell you that there are quite a few apps doing the same under the hood tricks on the App store. :) On another note, do let me know if you figure a better way out somehow someway sometime :)

这篇关于在UISplitViewController和其他视图控制器之间切换的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆