WWDC 2016 Sample Code

Learn how to implement the latest Apple technologies with sample code from WWDC 2016 sessions.

  • APFSCloning: Using clone APIs with APFS

    This sample demonstrates use of the COPYFILE_CLONE option for copyfile(3) and clonefileat(2) for cloning of files on APFS.

    Platforms:

    • OS X
  • AVCam-iOS: Using AVFoundation to Capture Images and Movies

    Demonstrates how to use the AVFoundation capture API to record movies and capture still images.

    Platforms:

    • iOS
  • AVCamBarcode: Using AVFoundation to Detect Barcodes and Faces

    This sample demonstrates how to use the AVFoundation capture API to detect barcodes and faces.

    Platforms:

    • iOS
  • AVCamManual: Extending AVCam to Use Manual Capture API

    Demonstrates how to add manual controls for focus, exposure, and white balance to the AVCam sample application.

    Platforms:

    • iOS
  • AVFoundation Looping Player: Using AVQueuePlayer and AVPlayerLooper to demonstrate loop playback

    This sample is a collection of projects showing how to play an audio visual item in a loop using AVFoundation's AVQueuePlayer and/or AVPlayerLooper.

    Platforms:

    • OS X
    • iOS
  • AdaptiveElements: Implementing Your Own Adaptive Design with UIKit

    This sample shows how to use UIKit to lay out your app's elements in different sizes, from full-screen on the smallest iPhone to Multitasking on the biggest iPad. It shows how to make smart decisions about implementing your own design. It also demonstrates how to reuse elements in different sizes, so you can take advantage of all the available space without having to rewrite your entire app.

    Platforms:

    • iOS
  • Adopting Metal I: A practical approach to your first Metal app

    This sample is provided as example material for Adopting Metal I. Within this sample, you will see the core concepts from this session put into practice. This includes fundamental operations such as the creation and management of Pipeline State Objects, loading shaders, using command encoders with command buffers, and sending your encoded commands to the GPU.

    Platforms:

    • OS X
    • iOS
    • tvOS
  • Adopting Metal II: Designing and Implementing a Real-World Metal Renderer

    This sample is provided as example material for Adopting Metal II. Within this sample, you will find a ideal reference for the structure of a Metal based renderer. This project takes special care to highlight best practices in terms of data management, command buffer creation, and synchronization between CPU and GPU.

    Platforms:

    • OS X
    • iOS
    • tvOS
  • Animalify: Using Safari App Extensions to modify pages and communicate with native code

    This sample demonstrates how a Safari App Extension can modify the contents of webpages that its users visit, and how scripts injected into pages by the Safari App Extension can communicate with the app extension’s native code.

    Platforms:

    • OS X
  • Badger: Advanced Rendering in SceneKit

    This sample demonstrates how to build a SceneKit-based game with advanced graphics.

    Platforms:

    • OS X
    • iOS
    • tvOS
  • Basic Neural Network Subroutines: Using The Accelerate Framework's Convolution Filters

    This sample shows how to create and apply a convolution filter on a stack of images using the Accelerate framework's support for Basic Neural Network Subroutines (BNNS)

    Platforms:

    • OS X
  • BracketStripes: Using the Bracketed Capture API

    Illustrates the use of the still image bracketing APIs available in AVFoundation.

    Platforms:

    • iOS
  • DemoBots: Building a Cross Platform Game with SpriteKit and GameplayKit

    Shows how to create a cross-platform game for tvOS, iOS, and OS X that provides the best possible experience on every supported device. DemoBots is a fully-featured 2D game built with SpriteKit and GameplayKit, and written in Swift.

    Platforms:

    • OS X
    • iOS
    • tvOS
  • Emporium: A Simple Shopping Experience with Apple Pay

    Shows how to make Apple Pay payment requests, collect shipping and contact information, apply discounts for debit/credit cards, and use the Apple Pay button.

    Platforms:

    • iOS
    • watchOS
  • Example app using Photos framework

    Shows a basic Photos-like app which introduces the Photos framework.

    Platforms:

    • iOS
    • tvOS
  • Fox: Building a SceneKit Game with the Xcode Scene Editor

    Demonstrates how to build a SceneKit-based game using the Xcode Scene Editor.

    Platforms:

    • OS X
    • iOS
    • tvOS
  • HLS Catalog: Using AVFoundation to play and persist HTTP Live Streams

    This sample shows how to save HLS Streams to disk.

    Platforms:

    • iOS
  • Ice Cream Builder: A simple Messages app extension

    This sample is a simple example of building an app extension that interacts with the Messages app and lets users send interactive messages and create stickers.

    Platforms:

    • iOS
  • IntentHandling: Using the Intents framework to handle custom Siri request

    The IntentHandling sample is a collection of projects showing how to use the Intents framework to handle custom Siri request in different domains.

    Platforms:

    • iOS
  • LucidDreams: Protocol and Value Oriented Programming Sample Code

    LucidDreams is a sample that accompanies the "Protocol and Value Oriented Programming in UIKit Apps" WWDC 2016 session (#419). It's recommended that you watch the talk before looking at this sample. The app lets users log their dreams with detailed content like effects that occurred during the dream, creatures that they saw, and more.

    Platforms:

    • iOS
  • Metal Heaps And Fences: Using Heaps and Fences in Metal

    This sample demonstrates how to use Metal's heap and fence API, two new API concepts added to Apple's low-overhead graphics framework designed to further reduce the overhead of creating and using resources. The sample shows how to create separate heaps for static and dynamic textures. It also shows how to use fences to express dependencies between encoders that produce and consumer those dynamic textures. Dynamic textures not used together will also alias to reduce the amount of memory used.

    Platforms:

    • iOS
    • tvOS
  • MetalBasicTessellation: A demonstration of the Metal tessellation pipeline

    This sample shows how to tessellate a triangle or quad patch with adjustable per-patch tessellation factors.

    Platforms:

    • OS X
  • QuickSwitch: Supporting Quick Watch Switching with WatchConnectivity

    This sample shows how to support quick watch switching.

    Platforms:

    • iOS
    • watchOS
  • Sample Photo Editing Extension

    Demonstrates how to implement a Photo Editing extension for iOS and OS X

    Platforms:

    • OS X
    • iOS
  • Sample dictation commands

    Platforms:

    • OS X
  • SpeakToMe: Using Speech Recognition with AVAudioEngine

    Shows how to use SFSpeechRecognizer with AVAudioEngine to record what a user says and transcribe it into text.

    Platforms:

    • iOS
  • Speakerbox: Using CallKit to create a VoIP app

    This sample app demonstrates how to use CallKit framework in a VoIP app to allow it to integrate natively into the system.

    Platforms:

    • iOS
  • SpeedSketch: Leveraging touch input for a drawing application

    This sample demonstrates how to capture touch input on iOS into a series of strokes and rendering them in a fast, efficient and correct way on a Canvas. It shows how to get the highest fidelity and best latency when using Apple Pencil. It also touches on subclassing of UIGestureRecognizer, and on how to coordinate gestures between pencil and touches.

    Platforms:

    • iOS
  • Swift Playgrounds Starter Book

    Platforms:

    • iOS
  • Swift Standard Library Playground

    Platforms:

    • OS X
    • iOS
  • SwingWatch: Using Device Motion on the Watch

    This sample demonstrates how to use Device Motion for local processing on the watch. This sample application counts swings in a racquet sport and provides visual feedback to the user.

    Platforms:

    • watchOS
  • TVML Catalog: Using TVML Templates

    This sample demonstrates how to use TVML templates for tvOS applications.

    Platforms:

    • tvOS
  • TVML Guide: Core concepts in TVML and TVMLKit

    This sample is a collection of projects that each demonstrate a single concept for working with TVML and TVMLKit.

    Platforms:

    • tvOS
  • TalkingToTheLiveView: Sending messages to a Swift Playground live view and saving data to its key-value store

    This Playground Book demonstrates how to talk to the always-on live view process from the main process running the code in the editor.

    Platforms:

    • iOS
  • WatchBackgroundRefresh: Using WKRefreshBackgroundTask to update WatchKit apps in the background

    This sample demonstrates how to use WKRefreshBackgroundTask to update WatchKit apps in the background.

    Platforms:

    • watchOS
  • WatchKit Catalog: Using WatchKit Interface Elements

    Shows how to use the UI elements available in the WatchKit framework and provides useful tips on developing a great Watch app.

    Platforms:

    • iOS
    • watchOS