Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
228 views
in Technique[技术] by (71.8m points)

ios - UITableViewController and moving from an iPhone app to a Universal App

I'm working on upgrading my app to a Universal App, I made the app originally in xCode 3 so I'm not using storyboarding at all.

I have a navigation controller that pushes two UITableView Controllers like this on the iPhone version:

iPhone: Welcome Screen View -> UITableViewController -> UITableViewController (detail) -> ViewController

What is the best way to make this iPad ready?

I understand I need to use a SplitViewController. Do I push an iPad specific SplitViewController from the welcome screen if the device is an iPad:

iPad: Welcome Screen View -> SplitViewController -> View Controller

but use the UITableView controller if it is an iPhone app, or should I somehow implement it so that I am using the same class for both devices?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Your flow looks about right. The split view controller would actually hold UITableViewController and UITableViewController (detail), so you don't have to actually write any new classes. You just have to make it so when you tap on a row in UITableViewController, it doesn't tell the navigation controller to push the detail table view controller, rather it simply updates it.

Generally, UISplitViewController is the root class, so you wouldn't put it in UINavigationController (which I'm not sure if it's possible to do that anyway). See if you can make your welcome screen a modal view controller (maybe even presenting using the form sheet style). As for View Controller, it depends on what you're using that specific class for.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...