Giter Club home page Giter Club logo

ios-samples's Introduction

iOS Sample Code

This are the Apple iOS samples, sometimes with some slightly modifications, as a starting point for a personal training developing iOS applications.

Samples

General

  1. EADemo shows how to communicate from an iOS 3.x application, with an external accessory using the External Accessory (EA) Framework API.

  2. Formulaic is a sample iPhone app that illustrates how to effectively use the iPhone Accessibility API. Using the Accessibility API allows your app to work correctly with VoiceOver.

  3. iAdSuite demonstrates how to manage ADBannerViews in three common scenarios, an application with a single view controller (BasicAdBanner), an application that uses a UITabBarViewController (AdBannerTabbed), and an application that uses a UINavigationViewController (AdBannerNavigation).

  4. iPhoneUnitTests illustrates the use of unit tests to ensure that an application’s functionality does not degrade as its source code undergoes changes to improve the application or to fix bugs. The project showcases two types of unit tests: logic and application.

  5. Icons demonstrates the proper use of application icons on iOS.

  6. MailComposer demonstrates how to target older OS versions while building with newly released APIs. This sample also shows how to use the MessageUI framework to create and send email messages from within your application.

  7. MessageComposer demonstrates how to target older OS versions while building with newly released APIs. It also illustrates how to use the MessageUI framework to compose and send email and SMS messages from within your application.

  8. Teslameter implements a Teslameter, a magnetic field detector. It displays the raw x, y, and z magnetometer values, a plotted history of those values, and a computed magnitude (size or strength) of the magnetic field.

  9. Trailers is a Dashcode Project contains the Trailer web application built on stage at WWDC 09 Session 208. It fetches an RSS feed from Apple's trailers website, and then populates the UI with it, letting you browse and watch trailers of the upcoming movies.

Data Management

  1. AccelerometerGraph graphs the motion of the device. It demonstrates how to use the UIAccelerometer class and how to use Quartz2D and Core Animation to provide a high performance graph view. It also demonstrates a low-pass filter that you can use to isolate the effects of gravity, and a high-pass filter that you can use to remove the effects of gravity.

  2. BatteryStatus demonstrates the use of the battery status properties and notifications provided via the iPhone OS SDK.

  3. CopyPasteTile demonstrates how to implement the copy-cut-paste feature introduced in iPhone OS v3.0.

  4. CoreDataBooks illustrates a number of aspects of working with the Core Data framework with an iPhone application:

    • Use of an instance of NSFetchedResultsController object to manage a collection of objects to be displayed in a table view.
    • Use of a second managed object context to isolate changes during an add operation.
    • Undo and redo.
    • Database initialization.
  5. DateSectionTitles shows how to create section information for NSFetchedResultsController using dates.

  6. DocInteraction demonstrates how to use UIDocumentInteractionController to obtain information about documents and how to preview them.

  7. DrillDownSave 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. The drill-down or content hierarchy is generated from a plist file called 'outline.plist'.

  8. InternationalMountains demonstrates some ways to incorporate and manage localized data in an iPhone application.

  9. LaunchMe demonstrates how to register a new URL type. Registering a new URL type allows other applications to interact with yours.

  10. Locations represents the completed project from the Core Data Tutorial for iPhone OS. The application displays a list of events, which encapsulate a time stamp and a geographical location expressed in latitude and longitude, and allows the user to add and remove events.

  11. LocateMe demonstrates the two primary use cases for the Core Location Framework: getting the user's location and tracking changes to the user's location.

  12. Metronome demonstrates how to animate a rotation, interpret touch events, and display a simple application preferences view.

  13. PhotoLocations illustrates a Core Data application that uses more than one entity and uses transformable attributes. It also shows inferred migration of the persistent store.

  14. QuickContacts demonstrates how to use the Address Book UI controllers and various properties such as displayedProperties, allowsAddingToAddressBook, and displayPerson.

  15. SeismicXML demonstrates how to use NSXMLParser to parse XML data.

  16. SimpleEKDemo shows how to use EventKit and EventKitUI frameworks to access and edit calendar data in the Calendar database.

  17. TaggedLocations illustrates how to manipulate attributes and relationships in an iPhone application.

  18. Touches includes two packages:

    • Touches_Classic demonstrates how to handle touches using UIResponder's: touches began, touches moved, and touches ended.
    • Touches_GestureRecognizers demonstrates how to use UIGestureRecognizers introduced in iPhone OS 4.0 to handle touch events.
  19. WhichWayIsUp demonstrates how to use a UIViewController to track the orientation of the device. The application draws a small wooden crate that maintains the correct orientation as the user rotates the device.

User Experience

  1. Accessory demonstrates how to implement a custom accessory view for your UITableView in the form of a checkmark button.

  2. AppPrefs demonstrates how to display your app's preferences or settings in the "Settings" system application.

  3. AdvencedTableViewCells demonstrates several different ways to handle complex UITableViewCells.

  4. AlternateViews demonstrates how to implement alternate or distinguishing view controllers for each particular device orientation.

  5. BubbleLevel demonstrates how to receive and interpret acceleration information, animate a view, and display a utility view (used for calibration).

  6. CurrentAddress basic use of MapKit, displaying a map view and setting its region to current location.

  7. DateCell demonstrates formatted display of date objects in table cells and use of UIDatePicker to edit those values.

  8. HeadsUpUI demonstrates how to implement a headsUp or HUD-like user interface over the app's primary view controller.

  9. HeaderFooter how to implement and customize the 2 UIView properties of UITableView: header ('tableHeaderView') and footer ('tableFooterView'). It is designed to somewhat resemble the "Contacts" application, showing you ways to design your own header and footer content. It uses the UITableViewStyle: UITableViewStyleGrouped to achieve a more similar appearance as well.

  10. iPhoneCoreDataRecipes shows how you can use view controllers, table views, and Core Data in an iPhone application. The application uses the domain of organizing and presenting recipes to show how you can use the view controller as the organizing unit to manage screenfuls of information, and how you can leverage table views to display and edit data in an elegant fashion. Amongst the techniques shown are how to:

    • Combine tab bar and navigation controllers to create a complex navigation flow
    • Customize a navigation bar
    • Implement custom table view cells that reformat themselves in response to editing, removing unnecessary information to ensure that the display remains uncluttered
    • Customize a table header view
    • Present modal views
    • Use multiple entities in a Core Data application
    • Provide a default Core Data persistent store
  11. KeyboardAccessory shows how to use a keyboard accessory view.

  12. LazyTableImages demonstrates a multi-stage approach to loading and displaying a UITableView. It displays the top paid iPhone apps on Apple's App Store.

  13. MoveMe illustrates simple drawing, touch handling, and animation using UIKit and Core Animation.

  14. MultipleDetailViews shows how you can use UISplitViewController to manage multiple detail views.

  15. NavBar demonstrates how to use UINavigationController and UIViewController classes together as building blocks to your application's user interface. Use it as a launching pad in starting the development of your new application.

  16. PhotoPicker demonstrates how to choose images from the photo library, take a picture using the device's camera, and how to customize the look of the camera's user interface.

  17. Popovers demonstrates proper use of UIPopoverController in iOS.

  18. PageControl primarily demonstrates use of UIScrollView's paging functionality to use horizontal scrolling as a mechanism for navigating between different pages of content. With the iPad, this type of user interface is not really necessary since the screen is larger allowing for more content and detailed information.

  19. Scrolling demonstrates how to implement two different style UIScrollViews. The first scroller contains multiple images, showing how to layout large content with multiple chunks of data (in our case 5 separate UIImageViews).

  20. SimpleDrillDown shows how to create a basic drill down interface.

  21. SimpleGestureRecognizers shows how to use standard gesture recognizers.

  22. SimpleUndo illustrates how to use undo on iPhone.

  23. TransWeb demonstrates how to implement UIWebView with a transparent background.

  24. TableViewSuite shows how to use UITableView through a progression of increasingly advanced applications that display information about time zones.

    • The first example shows a simple list of the time zone names. It shows how to display a simple data set in a table view.
    • The second example shows the time zones split into sections by region, with the region name as the section heading. It shows how to create an indexed table view.
    • The third example shows how to set up a table view to display an index. The time zones are separated into sections using UILocalizedIndexedCollation.
  25. TableSearch demonstrates how to use the UISearchDisplayController object in conjunction with a UISearchBar, effectively filtering in and out the contents of that table. If an iPhone/iPod Touch application has large amounts of table data, this sample shows how to filter it down to a manageable amount if memory usage is a concern or you just want users to scroll through less content in a table.

  26. TableViewUpdates demonstrates how you can use animated updates to open and close sections of a table view for viewing, where each section represents a play, and each row contains a quotation from the play. It also uses gesture recognizers to respond to user input:

    • A UITapGestureRecognizer to allow tapping on the section headers to expand the section;
    • A UIPinchGestureRecognizer to allow dynamic changes to the height of table view rows; and
    • A UILongPressGestureRecognizer to allow press-and-hold on table view cells to initiate an email of the quotation.
  27. TouchCells demonstrates how to implement trackable-settable UIControls embedded in a UITableView. This approach is handy if an application already uses its accessory view to the right of the table cell, but still wants a check mark view that supports toggling states of individual row items. The green check mark on the left provides this need which is trackable (checked/unchecked) independent of table selection. This is a similar user interface to that of Mail's Inbox table where mail items can be individually checked and unchecked for deletion.

  28. ToolbarSearch 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.

  29. TopPaid demonstrates how to design and 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.

  30. TheElements provides access to the data contained in the Periodic Table of the Elements. TheElements provides this data in multiple formats, allowing you to sort the data by name, atomic number, symbol name, and an elements physical state at room temperature. The application illustrates the following techniques:

    • Configuring and responding to selections in a tab bar
    • Displaying information in a tableview using both plain and grouped style table views
    • Using navigation controllers to navigate deeper into a data structure
    • Subclassing UIView
    • Providing a custom UITableViewCell consisting of multiple subviews
    • Implementing the UITableViewDelegate protocol
    • Implementing the UITableViewDataSource protocol
    • Reacting to taps in views
    • Open a URL to an external web site using Safari
    • Flipping view content from front to back
    • Creating a reflection of a view in the interface
  31. UICatalog is a catalog exhibiting many views and controls in the UIKit framework, along with their various properties and styles.

Graphics & Animation

  1. MusicCube demonstrates basic use of OpenGL ES, OpenAL, Audio File Services on the iPhone for manipulating sound in a 3D environment.

  2. QuartzDemo is an iPhone OS application that demonstrates many of the Quartz2D APIs made available by the CoreGraphics framework. Quartz2D forms the foundation of all drawing on iPhone OS and provides facilities for drawing lines, polygons, curves, images, gradients, PDF and many other graphical facilities.

  3. PVRTextureLoader illustrates how to load a PVR texture file using the included PVRTexture class and then display it using OpenGL ES.

  4. Reflection shows how to implement a "reflection" special effect on a given UIImageView most commonly seen in iTunes and iPod player apps.

  5. GLPaint demonstrates how to support single finger painting using OpenGL ES. This sample also shows how to detect a "shake" motion of the device.

  6. GLImageProcessing demonstrates how to implement simple image processing filters (Brightness, Contrast, Saturation, Hue rotation, Sharpness) using OpenGL ES1.1. The sample also shows how to create simple procedural button icons using CoreGraphics.

  7. GLGravity demonstrates how to use the UIAccelerometer class in combination with OpenGL rendering. It shows how to extract the gravity vector from the accelerometer values using a basic low-pass filter, and how to build an OpenGL transformation matrix from it.

  8. GLSprite shows how to create a texture from an image.

  9. GLTextureAtlas demonstrates how to use a texture atlas to draw multiple objects with different textures simultaneously using OpenGL ES.

  10. ViewTransitions demonstrates how to perform transitions between two views using built-in Core Animation transitions.

  11. ZoomingPDFViewer demonstrates how to build a PDF viewer that supports zooming in or out at any level of zooming.

Networking & Internet

  1. AdvancedURLConnections demonstrates various advanced networking techniques with NSURLConnection. Specifically, it demonstrates how to respond to authentication challenges, how to modify the default server trust evaluation (for example, to support a server with a self-signed certificate), and how to provide client identities.

  2. BonjourWeb demonstrates how to find network services that are advertised by Bonjour.

  3. iPhone 3GS supports both OpenGL ES 1.1 and 2.0. GLES2Sample demonstrates how to create an OpenGL ES 1.1 and 2.0 compatible project. When running on 1st generation iPhone, iPhone 3G, and 1st and 2nd generation iPod touch the sample draws using OpenGL ES 1.1; when running on iPhone 3GS and 3rd generation iPod touch, the sample draws using OpenGL ES 2.0.

  4. MVCNetworking is a sample that shows how to create a network application using the Model-View-Controller design pattern. Specifically, it displays a photo gallery by getting the gallery's XML description, thumbnails and photos from a web server, and uses Core Data to cache this information locally.

  5. Reachability demonstrates how to use the System Configuration framework to monitor the network state of an iPhone or iPod touch.

  6. SimpleFTPSample shows how to do simple FTP transfers using the NSURLConnection and CFFTPStream APIs.

  7. SimpleNetworkStreams shows how to do simple networking using the NSStream API.
    The goal of this sample is very limited: it does not demonstrate everything you need to implement a fully fledged networking product (more on this below), rather, it focuses on using the NSStream API to move a realistic amount of data across the network.

  8. SimpleURLConnections shows how to do simple networking using the NSURLConnection API.

  9. WiTap demonstrates how to achieve network communication between applications. Using Bonjour, the application both advertises itself on the local network and displays a list of other instances of this application on the network.

Security

  1. CryptoExercise demonstrates the use of the two main Cryptographic API sets on the iPhone OS SDK.
  2. GenericKeychain shows how to navigate through the Keychain Services API provided by iOS. Its demonstration leverages the Generic Keychain Item class and provides a template on how to successfully set up calls to: SecItemAdd, SecItemCopyMatching, SecItemDelete, and SecItemUpdate.

Performance

  1. TopSongs shows you how to import data from XML into Core Data.
  2. URLCache demonstrate how an iPhone application can download a resource off the web, store it in the application's data directory, and use the local copy of the resource.
  3. XMLPerformance explores two approaches to parsing XML, focusing on performance with respect to speed, memory footprint, and user experience.

Maps

  1. Breadcrumb Demonstrates how to draw a path using the Map Kit overlay, MKOverlayView, that follows and tracks the user's current location. The included CrumbPath and CrumbPathView overlay and overlay view classes can be used for any path of points that are expected to change over time.

  2. HazardMap demonstrates how to create a custom Map Kit overlay and corresponding view to display USGS earthquake hazard data on top of an MKMapView.

  3. KMLViewer demonstrates how to use Map Kit's Annotations and Overlays to display KML (Keyhole Markup Language) files on top of an MKMapView.

  4. MapCallouts demonstrates the use of the MapKit framework, displaying a map view with custom MKAnnotations each with custom callouts.
    An annotation object on a map is any object that conforms to the MKAnnotation protocol and is displayed on the screen as a MKAnnotationView.
    Through the use of the MKAnnotation protocol and MKAnnotationView, this application shows how you can extend annotations with custom strings and left/right calloutAccessoryViews.

  5. WeatherMap demonstrates the use of the MapKit framework, displaying a map view with custom MKAnnotationViews.

  6. WorldCities demonstrates basic use of MapKit, including displaying a map view and setting its region. A list of cities are stored in a plist file loaded at launch time. Each city is represented by a "WorldCity" class which consists of a name, a latitude, and a longitude.

Audio & Video

  1. AddMusic demonstrates basic use of iPod library access, part of the Media Player framework.

  2. AQOfflineRenderTest demonstrates the use of the AudioQueueOfflineRender API.

  3. aurioTouch demonstrates use of the remote i/o audio unit for handling audio input and output. The application can display the input audio in one of the forms, a regular time domain waveform, a frequency domain waveform (computed by performing a fast fourier transform on the incoming signal), and a sonogram view (a view displaying the frequency content of a signal over time, with the color signaling relative power, the y axis being frequency and the x as time).

  4. avTouch demonstrates use of the AV Foundation framework for basic playback of an audio file.

  5. iPhoneMultichannelMixerTest demonstrates how to build an Audio Unit Graph connecting a MultiChannel Mixer instance to the RemoteIO unit.

  6. iPhoneMixerEQGraphTest demonstrates how to build an Audio Unit Graph connecting a MultiChannel Mixer to the iPodEQ unit then to the RemoteIO unit.

  7. iPhoneExtAudioFileConvertTest demonstrates the use of the ExtAudioFile API to convert from one audio format and file type to another.

  8. MixerHost demonstrates how to use the Multichannel Mixer audio unit in an iOS application. It also demonstrates how to use a render callback function to provide audio to an audio unit input bus.

  9. MoviePlayer_iPhone demonstrates how to use the Media Player Framework to play a movie full-screen.

  10. SpeakHere demonstrates basic use of Audio Queue Services, Audio File Services, and Audio Session Services on the iPhone and iPod touch for recording and playing back audio.

  11. SysSound demonstrates basic use of System Sound Services (declared in AudioToolbox/AudioServices.h) for playing short sounds and invoking vibration.

  12. oalTouch demonstrates basic use of OpenAL, Audio File Services, Core Animation, and Core Graphics Services on the iPhone for manipulating sound in a spatial environment.

GameCenter

  1. GKRocket demonstrates the major features of GameKit. It uses GKSession and GKVoiceChatService in a two player networked voice enabled game.

  2. GKTank demonstrates how to use the GKSession and GKPeerPickerController classes in the GameKit framework to add Peer-to-Peer Connectivity to an application.

  3. GKTapper demonstrates how to support GameCenter Leaderboards and Achievements. It also demonstrates using GKLeaderboardViewController and GKAchievementViewController to display this data.

Usage

To build a sample, clone the repository and checkout the sample branch.

ios-samples's People

Contributors

ischlecken avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.