Below is a list of iPhone OS Code Samples from Apple. Some of the samples might have been updated since I updated this list and there might be a few new samples so check the Apple Developer site for the latest information. Demonstrates many of the Quartz2D APIs made available by the CoreGraphics framework. Last change: Added masking and clipping demos. Made some of the demos dynamic. Cleaned up various inconsistencies in the code. |
This application demonstrates use of UIScrollView's paging functionality. Last change: Fixed issue where scrolling by dragging the UIScrollView did not update the UIPageControl. |
Demonstrates simple FTP operations using the NSURLConnection and CFFTPStream APIs. Last change: Added code that demonstrates how to reinterpret the names in an FTP listing using a different encoding. Also fixed a couple of minor bugs in the ListControllers table handling. |
Demonstrates the use of the MapKit, displaying a map view with custom MKAnnotationViews. Last change: New document. |
Demonstrates how to use the Address Book UI controllers and various properties. Last change: New document. |
Demonstrates basic use of MapKit, displaying a map view and setting its region to current location. Last change: New document. |
Demonstrates basic use of MapKit, including displaying a map view and setting its region. Last change: New document. |
Demonstrates how to implement the NSFastEnumeration protocol. Last change: New document. |
Asynchronously downloads images for a UITableView so the UI is more responsive. Last change: New document. |
This sample shows how to implement a "reflection" special effect on a given UIImageView. Last change: Fixed a memory leak in CreateGradientImage. |
This sample uses CoreLocation to get and track the user's location. Last change: Corrected backwards comparison of horizontal accuracy in GetLocationViewController. |
Demonstrates how to use a texture atlas to draw multiple objects with different textures simultaneously. Last change: Updated for iPhone OS 3.1. Use CADisplayLink as the preferred method for controlling animation timing, and fall back to NSTimer when running on a pre 3.1 device where CADisplayLink is not available. |
Demonstrates basic use of OpenGL ES, OpenAL, and Audio File Services for manipulating sound in a 3D environment. Last change: Updated for iPhone OS 3.1. Use CADisplayLink as the preferred method for controlling animation timing, and fall back to NSTimer when running on a pre 3.1 device where CADisplayLink is not available. |
Shows how to create an OpenGL texture from image data in a Core Graphics bitmap context. Last change: Updated for iPhone OS 3.1: Set texture parameters before creating the texture. This will save texture memory and texture loading time. Use CADisplayLink as the preferred method for controlling animation timing, and fall back to NSTimer when running on a pre 3.1 device where CADisplayLink is not available. |
Demonstrates how to support single finger painting using OpenGL ES. Last change: Updated for iPhone OS 3.1. Set texture parameters before creating the texture. This will save texture memory and texture loading time. Use the shake API available in iPhone OS 3.0 and later. Made the sample xib-based. |
Demonstrates how to use the UIAccelerometer class in combination with OpenGL ES rendering. Last change: Updated for iPhone OS 3.1. Use CADisplayLink as the preferred method for controlling animation timing, and fall back to NSTimer when running on a pre 3.1 device where CADisplayLink is not available. Made the sample xib-based. |
Demonstrates how to play audio items that are synced from a user's desktop iTunes library. Last change: Minor changes. |
TheElements is an iPhone application that provides access to the data contained in the Periodic Table of the Elements. Last change: Changed the target setting's "Code Signing Identity" to the proper value. |
Demonstrates simple networking using the NSURLConnection API. Last change: New document. |
This sample is a catalog exhibiting many of the UI elements found in the iPhone's UIKit framework. Last change: Improve the accessibility of UICatalog through use of the iPhone Accessibility API. |
Demonstrates networking using the NSStream API. Last change: Updated to bring the code and user interface in line with other related samples. |
Demonstrates using the ExtAudioFile API to convert from one audio format and file type to another. Last change: New document. |
iPhone example to play a single audio source using OpenAL Last change: remove underscores from variables |
Demonstrates how to use the UIAccelerometer class and filter its results. Last change: Improve the accessibility of AccelerometerGraph through use of the iPhone Accessibility API. |
Demonstrates how to build an Audio Unit Graph using the Multichannel Mixer and Remote I/O units. Last change: Editorial |
Demonstrates using Audio Queue offline render functionality using the AudioQueueOfflineRender API. Last change: Editorial |
iPhone example to monitor audio input and play it out (duplex audio I/O) Last change: Fix DC offset bug |
Demonstrates iPhone recording and playback using the Audio Toolbox framework. Last change: Add support for pausing playback when headphones are removed |
This Dashcode Project contains a Trailer web app, built using bidings, data sources, and more. Last change: Extracted the ReadMe out of the .dcproj bundle Default project to open on the Desktop template rather than the iPhone one |
This sample demonstrates how to create an OpenGL ES 1.1 and 2.0 compatible project. Last change: New document. |
AdvancedTableViewCells shows several methods for displaying complex content in UITableViewCells. Last change: New document. |
Shows how to monitor network state and host reachability. Last change: Simplified interface code, rewrote Reachability object to easily support monitoring multiple hosts, added code to track whether a connection will be required, and made sample fully asynchronous. |
Demonstrates how to use the iPhone Accessibility API to make an iPhone application accessible. Last change: First public version of a WWDC sample project. |
avTouch is a sample project for playing an audio file using the AVFoundation framework Last change: Update Base SDK to 2.2.1 |
Demonstrates importing data from an RSS feed into a Core Data store. Last change: Expanded ReadMe and added localization for SongsViewController. |
This sample illustrates how to manipulate attributes and relationships in an iPhone application. Last change: Added identifier to table view cell in EditableTableViewCell.xib. |
Demonstrates how to implement simple image processing filters using OpenGL ES1.1. Last change: New document. |
This application implements a Teslameter, a magnetic field detector. Last change: Cleaned up for post-WWDC publication. |
Shows how you can use view controllers, table views, and Core Data in an iPhone application. Last change: Added UIGraphicsEndImageContext and textFieldShouldReturn: method to RecipeDetailViewController.m. Added viewDidUnload methods to several view controllers. Cleaned up error-handling code. Added a xib file for TemperatureCell. |
Demonstrates how to implement copy, cut, and paste in your application. Last change: New document. |
Shows how to use UITableView through a progression of increasingly advanced applications. Last change: Corrected a memory leak in the displayMethod in CustomTableViewCellAppDelegate.m. |
Illustrates simple drawing, touch handling, and animation using UIKit and Core Animation. Last change: Corrected a memory leak where a CGPath was not released. |
Complete implementation of the Locations project from the Your First iPhone Application With Core Data tutorial. Last change: Added 'nonatomic' to property declarations for Event. |
Illustrates use of Core Data in an iPhone application. Last change: Fixed a memory leak in EditingViewController.m. |
Performance and parsing XML, focusing on speed, memory footprint, and user experience. Last change: Fixed a memory leak in LibXMLParser implementation of the NSURLConnection delegate method -connectionDidFinishLoading:. Improved autorelease pool management in Cocoa parser. |
Sample application demonstrating Peer-to-Peer Connectivity using GameKit framework. Last change: Minor edits. |
The WiTap sample application demonstrates how to achieve network communication between applications. Last change: Fixed table selection and cell update bugs, and added support for handling stream errors. |
A series of examples that illustrate how to use UIScrollView. Last change: Updated artwork. |
Shows how to find network services that are advertised by Bonjour. Last change: Fixed bug updating cells when all services are removed during a resolve. |
Illustrates a Core Data application that uses more than one entity and transformable attributes. Last change: New document. |
Illustrates the use of unit tests on an iPhone application project. Last change: New document. |
Demonstrates how to target older OS versions while building with newly released APIs. Last change: New document. |
Demonstrates formatted display of date objects in UITableViewCells and use of UIDatePicker to edit those values. Last change: New document. |
Demonstrates the use of the battery status properties and notifications provided via the iPhone OS SDK. Last change: New document. |
Demonstrates how to perform transitions between two views using built-in Core Animation transitions. Last change: Eliminated the TransitionView class. The code for creating and adding the transition is now in -performTransition in the ViewTransitionsAppDelegate. |
An example on how to properly use the Keychain Services API for iPhone OS. Last change: Added support for sharing keychain items between apps. Adopted iPhone OS 3.0 API for UITableView and UITableViewCell. |
Demonstrates how to display your app's preferences or settings in the "Settings" system application. Last change: More use of nibs, upgraded for 3.0 SDK due to deprecated APIs, Settings.bundle no longer builds as a separate Xcode target. |
Demonstrates how to handle multiple touches. Last change: Now uses nibs for view creation. Status bar is now displayed on launch with the intended style. |
Demonstrates how to implement and customize UITableView's header and footer views. Last change: Upgraded for 3.0 SDK due to deprecated APIs. |
Demonstrates how to restore the user's current location in a drill-down list style user interface and restore that location when the app is relaunched. Last change: Upgraded for 3.0 SDK due to deprecated APIs. |
Demonstrates how to use NSXMLParser to parse XML documents. Last change: Switched NSXMLParser to use initWithData: instead of initWithContentsOfURL: and implemented asynchronous NSURLConnection for download to give better control of network error handling. Consolidated parsing into app delegate for better handling of parse error callbacks and to avoid the design pattern of using the app delegate as a singleton for data access. Switched from custom UITableViewCell subclass to managing the layout with view tags to meet documented best practices. Modified Earthquake class to model numeric and date properties as numbers and dates instead of strings and merged string parsing code into the XML parsing code. Added use of the lat/lon data for opening Maps link. |
Highlights the Cryptographic APIs found in the Security framework and CommonCrypto for the iPhone OS SDK Last change: Adopted iPhone OS 3.0 UITableView and UITableViewCell APIs. Added check for availability of WiFi network. Made minor bug fix in hash computation. |
Demonstrates how to implement trackable-settable UIControls embedded in a UITableView. Last change: Adopted iPhone OS 3.0 UITableView and UITableViewCell APIs. |
Demonstrates how to search contents of a UITableView using UISearchBar and UISearchDisplayController. Last change: Updated UISearchBar and UISearchDisplayController as nib objects. |
Demonstrates how to use the Media Player framework to play a movie full-screen. Last change: Added support for receiving streaming audio and video over HTTP. |
Illustrates a simple drill-down application using a UITableView. Last change: Upgraded for 3.0 SDK due to deprecated APIs. |
Demonstrates how to use UINavigationController and UIViewController classes as building blocks to your application's user interface. Last change: Upgraded for 3.0 SDK due to deprecated APIs. |
This sample demonstrates ways to incorporate and manage localized data in an iPhone application. Last change: New document. |
Demonstrates how to implement alternate or distinguishing view controllers for each particular device orientation. Last change: New document. |
Demonstrates how to implement a custom accessory view for your UITableView in the form of a checkmark button. Last change: Upgraded for 3.0 SDK due to deprecated APIs. |
Demonstrates how to implement UIWebView with a transparent background. Last change: New document. |
This application illustrates how to load PVR texture files and then display them using OpenGL. Last change: Fixed a bug in the Encode Images script. |
Simulates the operation of a simple mechanical metronome. Last change: Added invocation of prepareToPlay for the AVAudioPlayer instances. |
Illustrates how to use undo on iPhone. Last change: New document. |
Demonstrates how to download a resource, store it in the data directory, and use the local copy. Last change: New document. |
Demonstrates how to implement two different style UIScrollViews: single image, and multiple images. Last change: New document. |
Demonstrates how to play short sounds and invoke vibration. Last change: New document. |
Demonstrates how to implement a headsUp or HUD-like user interface over the app's primary view controller. Last change: New document. |
Tracks the orientation of the device. Last change: First public release. |
Demonstrates how to edit text with a keyboard and how to display the text in a label. Last change: First public release. |
Demonstrates how to register and service incoming requests of a new URL type. Last change: First public release. |
Simulates the operation of a simple, physical bubble level. Last change: First public release. |
0 Comments