其实, 开发了这么久, 不得不说, 苹果官方的Demo才是对某一个框架或者是某一个功能模块的完美的诠释, 所以, 在今天给大家贡献这些Demo的描述以及Git的下载地址, 大家可以自行阅读Demo, 提高编码水平。
点击左上角的Download
![](https://i-blog.csdnimg.cn/blog_migrate/702878b1d762f4d2a1012f4886bc4a67.webp?x-image-process=image/format,png)
Demo
Mirror of Apple's iOS samples
This repository mirrors Apple's iOS samples.
Name | Topic | Framework | Description |
---|---|---|---|
ABUIGroups | Data Management (Contact Data) | AddressBook | ABUIGroups shows how to check and request access to a user’s address book database. It also demonstrates how to retrieve, add, and remove group records using AddressBook APIs. It displays groups organized by their source in the address book. |
AccelerometerGraph | Data Management (Device Information) | UIKit | AccelerometerGraph sample application 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. |
AdaptivePhotos: An Adaptive Application | User Experience | UIKit | This sample shows how to use new APIs introduced in iOS 8 to make your application work great on all devices and orientations. It uses size classes, traits, and additions to view controllers to make an app that works great at any size and configuration. |
AddMusic | Audio & Video (Audio) | MediaPlayer | AddMusic demonstrates basic use of iPod library access, part of the Media Player framework. You use iPod library access to play songs, audio books, and audio podcasts that are synced from a user's desktop iTunes library. This sample uses the Media Player framework's built-in user interface for choosing music. AddMusic also demonstrates how to mix application audio with iPod library audio. The sample includes code for configuring application audio behavior using the AVAudioSession class and Audio Session Services. |
AdvancedURLConnections | Networking & Internet (Protocol Streams) | Foundation | This sample 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. |
Adventure: Building a SpriteKit Game Using Swift | Languages & Utilities (Swift) | SpriteKit | This sample shows how to build a simple 2D game for iOS and OS X using SpriteKit and Swift. |
AirDrop Examples | Networking & Internet | "AirDropSample" demonstrates three use cases for incorporating AirDrop into an app. | |
AirLocate: Using CoreLocation to monitor, range, and configure your device as an iBeacon | CoreLocation | "AirLocate" demonstrates CoreLocation fencing and ranging of iBeacons, BTLE devices enabled to aide iOS devices in determining a users proximity to a location rather than their position. Obtaining a users proximity with iBeacons is ideal in more intimate locations such as indoors where other positioning methods either do not work, or do not give the desired level of accuracy an iBeacon can provide. In addition to demonstrating how to use CoreLocation's CLLocationManager APIs to monitor and range for these CLBeaconRegions, AirLocate also provides an example of how to calibrate and configure an iOS device as a beacon. | |
Alternate Views | User Experience (Windows & Views) | UIKit | This sample demonstrates how to implement alternate or distinguishing views for particular device orientations. Doing so can be useful if your app displays different content between orientations or if your app uses vastly different layouts between orientations which cannot be reconciled by auto layout or programatic layout alone. |
Application Icons and Launch Images for iOS | General | UIKit | Every app is required to include an app icon. It is recommended that apps also provide icons for: Spotlight, the Settings app, and when creating an Ad Hoc build and adding it to iTunes. See QA1686: App Icons on iPad and iPhone, for a complete listing of icons required for iPhone, iPad, and Universal appshttps://developer.apple.com/library/ios/qa/qa1686/_index.html. |
AppPrefs: Storing and Retrieving User Preferences | Data Management (Preference Settings) | UIKit | Demonstrates how to display your app's user configurable options (preferences) in the "Settings" system application. A settings bundle, included in your application’s bundle directory, contains the information needed by the Settings application to display your preferences and make it possible for the user to modify them. The Settings application saves any configured values in the defaults database so that your application can retrieve them at runtime. This sample also shows how to launch the Settings app from your application and how to dynamically update your application's UI when its settings are changed while the app is in the background. |
AQOfflineRenderTest | Audio & Video (Audio) | AudioToolbox | Demonstrates using Audio Queue offline render functionality and the AudioQueueOfflineRender API. The sample produces LPCM output buffers from an ALAC encoded source which are then written to a .caf file. The output.caf file is then played back confirming the offline functionality worked as expected. All the code demonstrating the Audio Queue is in a single file called aqofflinerender.cpp. |
Audio Converter File Convert Test | Audio & Video (Audio) | AudioToolbox | Demonstrates using the Audio Converter APIs to convert from a PCM audio format to a compressed format including AAC. |
Audio Mixer (MixerHost) | Audio & Video (Audio) | AudioUnit | 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. In this sample, the audio delivered by the callback comes from two short loops read from disk. You could use a similar callback, however, to synthesize sounds to feed into a mixer unit. This sample is described in Audio Unit Hosting Guide for iOS. |
Audio UI Sounds (SysSound) | Audio & Video (Audio) | AudioToolbox | Demonstrates use of System Sound Services (AudioToolbox/AudioServices.h) to play alerts and user-interface sound effects, and to invoke vibration. |
aurioTouch | Audio & Video (Audio) | AudioUnit | 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). Tap the sonogram button to switch to a sonogram view, tap anywhere on the screen to return to the oscilloscope. Tap the FFT button to perform and display the input data after an FFT transform. Pinch in the oscilloscope view to expand and contract the scale for the x axis. |
AVARLDelegateDemo | Audio & Video | AVFoundation | The sample code depicts three different use cases of AVAssetResourceLoaderDelegate (for Identity encryption use case scenarios) for HLS (HTTP Live streaming): - Redirect handler (redirection for the HTTP live streaming media files) - Fetching Encryption keys for the HTTP live streaming media (segments) - Custom play list generation (index file) for the HTTP live streaming. |
AVCam for iOS | Audio & Video | AVFoundation | AVCam demonstrates how to use the AV Foundation capture APIs for recording movies and taking still images. There is a record button for recording movies, a camera button for switching between front and back cameras (on supported devices), and a still button for taking still images. It runs only on an actual device, either an iPad or iPhone, and cannot be run in the simulator. |
AVCamManual: Using the Manual Capture API | AVFoundation | AVCamManual adds manual controls for focus, exposure, and white balance to the AVCam sample application. | |
AVCaptureAudioDataOutput To AudioUnit iOS | Audio & Video (Audio) | AVFoundation | AVCaptureToAudioUnit for iOS demonstrates how to use the CMSampleBufferRefs vended by AVFoundation's capture AVCaptureAudioDataOutput object with various CoreAudio APIs. The application uses a AVCaptureSession with a AVCaptureAudioDataOutput to capture audio from the default input, applies an effect to that audio using a simple delay effect AudioUnit and writes the modified audio to a file using the CoreAudio ExtAudioFile API. It also demonstrates using and AUGraph containing an AUConverter to convert the AVCaptureAudioDataOutput provided data format into a suitable format for the delay effect. |
AVCompositionDebugVieweriOS | Audio & Video | AVFoundation | This sample application has an AVCompositionDebugView which presents a visual description of the underlying AVComposition, AVVideoComposition and AVAudioMix objects which form the composition made using two clips, adding a cross fade transition in between and audio ramps to the two audio tracks. The visualization provided by the sample can be used as a debugging tool to discover issues with an incorrect composition/video composition. For example: a break in video composition would render black frames to screen, which can easily be detected using the visualization in the sample. |
AVCustomEdit | Audio & Video | AVFoundation | The sample demonstrates the use of custom compositors to add transitions to an AVMutableComposition. It implements the AVVideoCompositing and AVVideoCompositionInstruction protocols to have access to individual source frames, which are then be rendered using OpenGL off screen rendering. |
AVLoupe | Audio & Video (Video) | AVFoundation | This sample demonstrates how to use multiple synchronized AVPlayerLayer instances, associated with a single AVPlayer, to efficiently produce non-trivial presentation of timed visual media. Using just one AVPlayer this sample demonstrates how you can display the same video in multiple AVPlayerLayers simultaneously. With minimal code you can create very customized and creative forms of video display. As an example, this sample demonstrates an interactive loupe, or magnifying glass, for video playback. This is similar to features that you might have used in iPhoto and Aperture. |
AVMovieExporter | Audio & Video (Video) | AVFoundation | This universal sample application reads movie files from the Asset Library and Media Library then exports them to a new media file using user defined settings. The user can adjust the exported file in the following ways: |
AVPlayerDemo | Audio & Video (Video) | AVFoundation | Uses AVPlayer to play videos from the iPod Library, Camera Roll, or via iTunes File Sharing. Also displays metadata. |
AVSimpleEditoriOS | Audio & Video | AVFoundation | AVSimpleEditor is a simple AVFoundation based movie editing application which exercises the APIs of AVVideoComposition, AVAudioMix and demonstrates how they can be used for simple video editing tasks. It also demonstrates how they interact with playback (AVPlayerItem) and export (AVAssetExportSession). The application performs trim, rotate, crop, add music, add watermark and export. This sample is ARC-enabled. |
AVTimedAnnotationWriter: Using Custom Annotation Metadata for Movie Writing and Playback | AVFoundation | Demonstrates how to use the AVAssetWriterInputMetadataAdaptor API to write circle annotation metadata during video playback. The captured movie file has video, audio and metadata track. The metadata track contains circle annotation which is vended during playback using AVPlayerItemMetadataOutput. | |
avTouch | Audio & Video (Audio) | AVFoundation | The avTouch sample demonstrates use of the AVAudioPlayer class for basic audio playback. |
Bananas: A simple SceneKit platforming game | Graphics & Animation (3D Drawing) | SceneKit | This sample shows how to build a basic game using Scene Kit, demonstrating physics, rendering techniques, lighting, actions and animation. |
Blurring and Tinting an Image | Graphics & Animation | UIKit | UIImageEffects demonstrates how to create and apply blur and tint effects to an image using the vImage, Quartz, and UIKit frameworks. The vImage framework is suited for high-performance image processing. Using vImage, your app gets all the benefits of vector processing without the need for you to write vectorized code. |
BonjourWeb | Networking & Internet (Services & Discovery) | Foundation | This application illustrates the fundamentals of browsing for network services using Bonjour. The BonjourBrowser hierarchically displays Bonjour domains and services as table views in a navigation controller. The contents of the table views are discovered and updated dynamically using NSNetServiceBrowser objects. Tapping an item in the services table causes the corresponding NSNetService object to be resolved asynchronously. When that resolution completes, a delegate method is called which constructs a URL and opens it in Safari. |
BracketStripes: Using the Bracketed Capture API | AVFoundation | BracketStripes This sample illustrates the use of still image bracketing APIs available in AVFoundation. Two types of brackets are demonstrated: 1. Auto-exposure brackets with exposure target bias, and 2. Manual exposure with control over ISO and exposure duration. As each of the bracketed frames are captured in real-time, they are "striped" into a destination image buffer and later shown in a modal image viewer so each of the captured frames can be compared side-by-side. | |
Breadcrumb | User Experience | MapKit | 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. It also demonstrates what is needed to track the user's location as a background process. |
BTLE Central Peripheral Transfer | CoreBluetooth | This sample shows how to transfer data from an iOS device in CoreBluetooth Peripheral Mode to another in Central Mode, by using a CBCharacteristic on the Peripheral side that changes its value. The value change is automatically picked up on the Central side. | |
Checking and Requesting Access to Data Classes in Privacy Settings | Security | "PrivacyPrompts" shows how to check and request access to data classes such as Location, Contacts, and social media in Privacy Settings on iOS. | |
CloudCaptions: How integrate CloudKit into your application | CloudKit | This sample shows how to use CloudKit to upload and retrieve CKRecords and associated assets. In this example, there are two record types, an image record type and a post record type. Users are able to upload their own photos or select an image already found in an image record type. This example also uses an NSPredicate in its CKQueries to filter results based on tags. | |