iPad Development : The Split View Concept

11/20/2010 3:19:35 PM
Up to this point, Dudel has been a fun toy, but it has at least one quite severe limitation: Apart from sending your drawing as e-mail, you have no way of saving what you've drawn. As soon as you quit the app, your work is gone! That's clearly not the way any iPhone or iPad app should work, so we're going to remedy that, and give the user a way to save any number of Dudel documents. We'll use a UISplitViewController to help us out here, so we can display an additional view controller that shows a list of all relevant files, letting the user switch between them easily.

The UISplitViewController, like the UINavigationController and UITabBarController, serves an organizational function. Rather than displaying any content on its own, it shows the view for an additional controller next to the main controller view in landscape mode, as shown in Figure 1.

Figure 1. Some inspiring Dudel art. Notice the list of available Dudel files on the left.


The use of the UISplitViewController, in combination with a toolbar at the bottom of the main view, is somewhat unorthodox. The UISplitViewController always creates the left-side view with a title row at the top ("My Dudels" here), and Apple's recommendation when using UISplitViewController is to put the main view's toolbar (if any) at the top as well. I didn't do this for Dudel, and it does give the screen a slightly lopsided appearance. But I think this adds character! Of course, you're free to move the main view's toolbar to the top if you wish, to bring it more in line with what Apple recommends. And when you use a UISplitViewController in your own apps, you should probably put your main view's toolbar at the top, unless you have a good reason not to (a better reason than my claims of adding character!). If you rotate the device to portrait mode, something interesting happens. The UISplitViewController switches gears, and no longer shows a list of files on the left. Instead, it gives a UIBarButtonItem to its delegate (a view controller of our own), which can then add it to a toolbar. That button item, when touched, brings up the same view that was shown on the left side in landscape mode, this time displayed using a UIPopoverController, as shown in Figure 2.

Figure 2. In portrait mode, the file list is shown only when you click the button that brings up the popover.

This one will require no configuration on our part, since the UISplitViewController sets it up for us. However, we will still be required to dismiss the popover after the user makes a selection.

You might also notice in Figures 1 and 2 that the Email PDF button at the lower right has been swapped out for a generic action icon button. This will bring up a menu containing a handful of operations such as creating, renaming, and deleting files, which set up in this chapter.

Other -----------------
- jQuery 1.3 : Developing plugins - Adding new shortcut methods
- jQuery 1.3 : Developing plugins - DOM traversal methods
- Using Cloud Services : Exploring Online Planning and Task Management
- Using Cloud Services : Exploring Online Scheduling Applications
- Using Cloud Services : Exploring Online Calendar Applications
- SOA with .NET and Windows Azure : Service Contracts with WCF (part 3)
- SOA with .NET and Windows Azure : Service Contracts with WCF (part 2)
- SOA with .NET and Windows Azure : Service Contracts with WCF (part 1)
- Cloud Security and Privacy : Data Security and Storage
- iPad SDK : Working with Documents - Desktop Synchronization
- Required Project Images for iPad Apps
- iPhone SDK : GameKit Voice Chat
- iPhone SDK : Creating Basic GameKit Services (part 2) : Sending and Receiving Data
- iPhone SDK : Creating Basic GameKit Services (part 1)
- iPad : Navigating with Maps
- Adding iPad to the Mix
- A Brief History of Legacy .NET Distributed Technologies : .NET Remoting
- A Brief History of Legacy .NET Distributed Technologies : .NET Enterprise Services
- iPad SDK : Outputting to an External Screen
- iPad SDK : Displaying Multiple Videos
- First look: Apple Watch

- 10 Amazing Tools You Should Be Using with Dropbox

- Sigma 24mm f/1.4 DG HSM Art

- Canon EF11-24mm f/4L USM

- Creative Sound Blaster Roar 2

- Alienware 17 - Dell's Alienware laptops

- Smartwatch : Wellograph

- Xiaomi Redmi 2
Popular tags
Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 Adobe Indesign Adobe Flash Professional Dreamweaver Adobe Illustrator Adobe After Effects Adobe Photoshop Adobe Fireworks Adobe Flash Catalyst Corel Painter X CorelDRAW X5 CorelDraw 10 QuarkXPress 8 windows Phone 7 windows Phone 8