首页 编程 软件学院 查看内容

iOS 苹果官方Demo合集

2015-7-22 15:31 9266 0

摘要: 其实, 开发了这么久, 不得不说, 苹果官方的Demo才是对某一个框架或者是某一个功能模块的完美的诠释, 所以, 在今天给大家贡献这些Demo的描述以及Git的下载地址, 大家可以自行阅读Demo, 提高编码水平。 点击左上角的Do ...
关键词: demonstrates Audio sample application using how Video use AVFoundation Data

其实, 开发了这么久, 不得不说, 苹果官方的Demo才是对某一个框架或者是某一个功能模块的完美的诠释, 所以, 在今天给大家贡献这些Demo的描述以及Git的下载地址, 大家可以自行阅读Demo, 提高编码水平。

点击左上角的Download


Demo

GitHub 文章链接地址, 欢迎Star+Fork

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 inte**ce 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 ** 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 apps https://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-inte**ce 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 ** 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.
AV**EditoriOS Audio & Video AVFoundation AV**Editor is a ** AVFoundation based movie editing application which exercises the APIs of AVVideoComposition, AVAudioMix and demonstrates how they can be used for ** 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 ** 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.
CloudKitAtlas: An Introduction to CloudKit
CloudKit CloudKitAtlas is a sample intended as a quick introduction to CloudKit. It teaches you how to use discoverability to get the first name and last name of the user logged into iCloud. It can add a CKRecord with a location and query for CKRecords near a location. You can upload and retrieve images as CKAssets. It also shows how to use CKReferences with CKReferenceActionDeleteSelf so the child records are deleted when the parent record is deleted. Finally, it also shows how to use CKSubscription to get push notifications when a new item is added for a record type.
Collection View Transition User Experience (Windows & Views) UIKit This sample illustrates how to create a custom transition when navigating between two collection views in a navigation hierarchy managed by a navigation controller. The transition can be interrupted and reversed. It uses a subclass of UICollectionViewTransitionLayout to help in the transition of the cell positions based on gesture position.
CollectionView-**
UIKit Demonstrates how to use UICollectionView, a way to present ordered data to users in a grid-like fashion. With a collection view object, you are able to define the presentation and arrangement of embedded views. The collection view class works closely with an accompanying layout object to define the placement of individual data items. In this example UIKit provides a standard flow-based layout object that you can use to implement multi-column grids containing items of a standard size.
Concurrent operations using Core Data User Experience (Tables) CoreData Demonstrates how to use Core Data in a multi-threaded environment, following the first recommended pattern mentioned in the Core Data Programming Guide.
Core Audio Utility Classes Audio & Video (Audio) CoreAudio The "CoreAudio" folder contains the Public Utility sources (PublicUtility folder) as well as base classes required for codec and audio unit development. These utility classes are used by various Apple Core Audio sample project and extend or wrap Core Audio API's.
Core Data Transformable Attributes Data Management CoreData This sample illustrates a Core Data application that uses more than one entity and uses transformable attributes. It also shows inferred migration of the persistent store.
Core Image Filters with Photos and Video for iOS Graphics & Animation (2D Drawing) CoreImage The CIFunHouse project shows how to apply Core Image built in and custom CIFilters to photos and video. The application presents view controllers for adding photo and video sources, choosing CIFilters from a list, and ** live adjustments to filter parameters. The project also contains code for custom CIFilter subclasses for effect such as Sobel edge detection, old-style-film, and fake-depth-of-field looks. The code also demonstrates how to save a filtered video stream to the ALAssetsLibrary while simultaneously previewing the video on the display.
CoreBluetooth Temperature Sensor
CoreBluetooth A ** iOS iPhone application that demonstrates how to use the CoreBluetooth Framework to connect to a Bluetooth LE peripheral and read, write and be notified of changes to the characteristics of the peripheral.
CoreDataBooks Data Management CoreData This sample illustrates a number of aspects of working with the Core Data framework with an iOS application:
CoreTextPageViewer User Experience (Windows & Views) CoreText This sample shows how to use Core Text to display large bodies of text, text with mixed styles, and text with special style or layout requirements, such as use of custom fonts. A version of this sample was used in the "Advanced Text Handling for iPhone OS" WWDC 2010 Session.
CryptoExercise Security Security This sample demonstrates the use of the two main Cryptographic API sets on the iPhone OS SDK. Asymmetric Key Encryption and random nonce generation is handled through the Security framework API set, whereas, Symmetric Key Encryption and Digest generation is handled by the CommonCrypto API set. The CryptoExercise sample brings both of these APIs together through a network service, discoverable via Bonjour, that performs a "dummy" cryptographic protocol between devices found on the same subnet.
CurrentAddress User Experience MapKit Demonstrates basic use of MapKit, displaying a map view and setting its region to current location.
Custom Animatable Property Graphics & Animation (Animation) CoreGraphics Shows how to leverage Core Animation’s timing and rendering callbacks to implement custom animatable properties for CALayer subclasses. This technique is supported whether your CALayer subclass belongs to a UIView or is standalone. Both explicit and implicit animation triggers are demonstrated, as well as basic and keyframe animation types.
Custom Section Titles with NSFetchedResultsController Data Management CoreData "DateSectionTitles" shows how to create section information for NSFetchedResultsController using dates.
CustomContentAccessibility User Experience UIKit This sample, previously known as WWDCMaps, shows you how to support accessibility in a custom drawing UIView and UIControl, demonstrates how to create an accessibility element for each map item, and implement UIAccessibilityContainer protocol in the container view to interact with iOS accessibility system. The Guided Access Restriction API, which is newly introduced in iOS 7 for restricting functions when Guided Access enabled, is also demonstrated in this sample.
CustomHTTPProtocol Networking & Internet Foundation CustomHTTPProtocol shows how to use an NSURLProtocol subclass to intercept the NSURLConnections made by a high-level subsystem that does not otherwise expose its network connections. In this specific case, it intercepts the HTTPS requests made by a web view and overrides server trust evaluation, allowing you to browse a site whose certificate is not trusted by default.
Customizing UINavigationBar User Experience (Controls) UIKit NavBar demonstrates using UINavigationController and UIViewController classes together as building blocks to your application's user inte**ce. Use it as a reference when starting the development of your new application. The various pages in this sample exhibit different ways of how to modify the navigation bar directly, using the appearance proxy, and by modifying the view controller's UINavigationItem. Among the levels of customization are varying appearance styles, and applying custom left and right buttons known as UIBarButtonItems.
DateCell User Experience (Tables) UIKit Demonstrates formatted display of date objects in table cells and use of UIDatePicker to edit those values.
DocInteraction Data Management (File Management) UIKit Demonstrates how to use UIDocumentInteractionController to obtain information about documents and how to preview them. There are two ways to preview documents: one is to use UIDocumentInteractionController's preview API, the other is directly use QLPreviewController. This sample also demonstrates the use of UIFileSharingEnabled feature so you can upload documents to the application using iTunes and then to preview them. With the help of "kqueue" kernel event notifications, the sample monitors the contents of the Documents folder.
DownloadFont
CoreText Demonstrates how to download fonts on demand on iOS 6 and later.
EADemo Data Management (Device Information) ExternalAccessory The sample can be used with any Made For iPod (MFI) device designed for use with the External Accessory Framework. The application will display an External Accessory attached device in the Accessories window, provide information registered by the MFI device, and provides methods to send and receive data to the device.
Enumeration Sample
Foundation EnumerationSample is a command line project that demonstrates how to implement a class that supports block-based enumeration, fast enumeration, enumeration using NSEnumerator, and subscripting. While provided as a OS X application, the techniques demonstrated by this sample are fully applicable to iOS development.
Example app using Photos framework
Photos A basic Photos-like app which introduces the Photos framework. - List albums, folders and moments - Display the contents of the moments, or a single album - Display the content of a single photo or video (and allow playback in the case of a video) - Allow the following actions: ** single-click edit of a photo creating an album and adding assets to it re-ordering of assets in an album removing assets from an album deleting assets and albums (un)hiding an asset from moments * favoriting an asset
Extended Audio File Conversion Test Audio & Video (Audio) AudioToolbox Demonstrates using ExtAudioFile API to convert from one audio format and file type to another.
Fit: Store and Retrieve HealthKit Data
HealthKit Fit is a sample intended as a quick introduction to HealthKit. It teaches you everything from writing data into HealthKit to reading data from HealthKit. This information may have been entered into the store by some other app; e.g. a user's birthday may have been entered into Health, and a user's weight by some popular weight tracker app. Fit shows examples of using queries to retrieve information from HealthKit using sample queries and statistics queries. Fit gives you a quick introduction into using the new Foundation classes NSLengthFormatter, NSMassFormatter, and NSEnergyFormatter.
Footprint: Indoor Positioning with Core Location
CoreLocation Use Core Location to take a Latitude/Longitude position and project it onto a flat floorplan. Demonstrates how to do the conversion from the Geographic coordinates system (Latitude/Longitude) to the floorplan's image coordinate system (x,y).
GenericKeychain Security Security This sample shows how to add, query for, remove, and update a keychain item of generic class type. Also demonstrates the use of shared keychain items. All classes exhibit very similar behavior so the included examples will scale to the other classes of Keychain Item: Internet Password, Certificate, Key, and Identity.
GeocoderDemo Data Management CoreLocation This sample application demonstrates using a CLGeocoder instance to perform forward and reverse geocoding on strings and dictionaries. The application also includes an example distance calculator that will display the distance between two placemarks.
Get Battery Status Data Management (Device Information) UIKit Demonstrates the use of the battery status properties and notifications provided via the iOS SDK.
GKAchievements General GameKit Abstract: Provide an example of how to successfully submit achievements and store them when submission fails.
GKAuthentication General GameKit An example of how to successfully authenticate using GameKit.
GKLeaderboards General GameKit GKLeaderboard is a sample application that shows how to correctly submit a score and view them using GKLeaderboardViewController.
GKTapper
GameKit GKTapper is a sample application that shows how to support GameCenter Leaderboards and Achievements. It also demonstrates using GKLeaderboardViewController and GKAchievementViewController to display this data.
GLAirplay User Experience OpenGLES Demonstrates how to provide a richer experience to your users when they are using Airplay by displaying your UI on the iPhone/iPad and your app/game contents on the second display.
GLCameraRipple Audio & Video (Video) AVFoundation This sample demonstrates how to use the AVFoundation framework to capture YUV frames from the camera and process them using shaders in OpenGL ES 2.0. CVOpenGLESTextureCache, which is new to iOS 5.0, is used to provide optimal performance when using the AVCaptureOutput as an OpenGL texture. In addition, a ripple effect is applied by modifying the texture coordinates of a densely tessellated quad.
GLEssentials Graphics & Animation (3D Drawing)
声明:文章版权归原作者所有 部分文章转自互联网 如有侵权请联系 [邮箱地址] 删除

路过

雷人

握手

鲜花

鸡蛋

最新评论