Sunday, January 16, 2011

Code samples for iPad

There are a few code samples for iPad development on Apple Developer website.

MultipleDetailViews :

This sample shows how you can use UISplitViewController to manage multiple detail views.
The application uses a split view controller with a table view controller as the root view controller. When you make a selection in the table view, a new view controller is created and set as the split view controller's second view controller.
The root view controller defines a protocol (SubstitutableDetailViewController) that detail view controllers must adopt. The protocol specifies methods to hide and show the bar button item controlling the popover.

This sample shows how to use standard gesture recognizers. A view controller creates four gesture recognizers to recognize a tap, a right swipe, a left swipe, and a rotation gesture. When they recognize a gesture, the recognizers send a suitable message to the view controller, which in turn displays an appropriate image at the location of the gesture.

This sample shows how to use a search field in a toolbar. When you start a search, a table view displaying recent searches matching the current search string is displayed in a popover.
The main view controller adds to a toolbar a bar button item with a search field as a custom view. If you tap the search field, the view controller presents a popover containing a list of recent searches. The list is stored in user defaults so that it persists between launches of the application, and is managed by the list's table view controller. The recents list is filtered by the current search term. If you select an item from the recents list, the item is copied to the search field and a search executed.

Shows how to use a keyboard accessory view. The application uses a single view controller. The view controller's view is covered by a text view. When you tap the text view, the view controller loads a nib file containing an accessory view that it assigns to the text view's inputAccessoryView property. The accessory view contains a button. When you tap the button, the text "You tapped me." is added to the text view. The sample also shows how you can use the keyboard-will-show and keyboard-will-hide notifications to animate resizing a view that is obscured by the keyboard.

This sample demonstrates how to build a universal application capable of running on both the iPhone and iPad. It shows the steps needed to make an existing iPhone application universal by introducing two unique user interface designs for both devices, yet using the same data model. The sample itself shows a multi-stage approach to loading and displaying a UITableView. It begins by loading the relevant text from an RSS feed so the table can load as quickly as possible, and then downloads the images for each row asynchronously so the UI is more responsive. 

This are the samples that I could find on Apple Developer that show some iPad development techniques. If you come across other iPad samples, Leave them in the comments.

No comments:

Post a Comment

Popular Posts