Programming4us
         
 
 
Programming

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.

NOTE

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
 
 
Most View
- Extending Microsoft Dynamics CRM 4.0 : Examples
- The Art of SEO : Duplicate Content Issues (part 3)
- BizTalk Server 2009 : Using queues within asynchronous scenarios (part 3)
- SharePoint 2010 : Choose a Column Type (part 9)
- Windows Azure : Programming Access Control Service (part 4)
- jQuery 1.3 : Improving a basic form (part 6)
- Microsoft Dynamics GP 2010 : Populating Initial Data - Inventory items
- Windows 7 : Managing a User Account
- Managing Windows Server 2012 Storage and File Systems : Storage Management (part 4) - Installing and configuring file services - Configuring Hyper-V
- Exchange 2007 : Perform a Mailbox Active/Passive Installation
Top 10
- Implementing Edge Services for an Exchange Server 2007 Environment : Utilizing the Basic Sender and Recipient Connection Filters (part 3) - Configuring Recipient Filtering
- Implementing Edge Services for an Exchange Server 2007 Environment : Utilizing the Basic Sender and Recipient Connection Filters (part 2)
- Implementing Edge Services for an Exchange Server 2007 Environment : Utilizing the Basic Sender and Recipient Connection Filters (part 1)
- Implementing Edge Services for an Exchange Server 2007 Environment : Installing and Configuring the Edge Transport Server Components
- What's New in SharePoint 2013 (part 7) - BCS
- What's New in SharePoint 2013 (part 6) - SEARCH
- What's New in SharePoint 2013 (part 6) - WEB CONTENT MANAGEMENT
- What's New in SharePoint 2013 (part 5) - ENTERPRISE CONTENT MANAGEMENT
- What's New in SharePoint 2013 (part 4) - WORKFLOWS
- What's New in SharePoint 2013 (part 3) - REMOTE EVENTS