227 creating modern cocoa apps df - apple inc. · nsstring *greeting = @"hello, world!";...

160
© 2014 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple. #WWDC14 Creating Modern Cocoa Apps Session 227 Tony Parker Software Engineer, Cocoa Frameworks Frameworks

Upload: others

Post on 21-May-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

© 2014 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple.

#WWDC14

Creating Modern Cocoa Apps

Session 227 Tony Parker Software Engineer, Cocoa Frameworks

Frameworks

Page 2: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

A Modern Cocoa App

Page 3: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

A Modern Cocoa App

Page 4: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Introducing Lister

Built with • Storyboards

• Auto Layout

• NSDocument

OS X and iOS

Objective-C and Swift

Page 5: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

adding to do items

Page 6: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

adding to do items

Page 7: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications
Page 8: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications
Page 9: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications
Page 10: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications
Page 11: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications
Page 12: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications
Page 13: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications
Page 14: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications
Page 15: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications
Page 16: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications
Page 17: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications
Page 18: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications
Page 19: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Agenda

Page 20: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Agenda

Getting started

Page 21: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Agenda

Getting started

Adding more features

Page 22: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Agenda

Getting started

Adding more features

Where to go next

Page 23: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Getting Started

Page 24: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Model, View, Controller

Page 25: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Model, View, Controller

Model

Page 26: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Model, View, Controller

View

Model

Page 27: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Model, View, Controller

View

Controller

Model

Page 28: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Storyboards

Page 29: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Storyboards

Starting point for creating views and controllers

Page 30: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Storyboards

Starting point for creating views and controllers

Consist of two parts

Page 31: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Storyboards

Starting point for creating views and controllers

Consist of two parts• Scenes

- Part of your user interface

Page 32: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Storyboards

Starting point for creating views and controllers

Consist of two parts• Scenes

- Part of your user interface

• Segues

- Transition from one scene to next

Page 33: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications
Page 34: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications
Page 35: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications
Page 36: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Storyboards

Great for rapid prototyping

Page 37: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Storyboards

Great for rapid prototyping

Compose to form more complicated interfaces

Page 38: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Related Sessions

• Storyboards and Controllers for OS X Pacific Heights Tuesday 4:30PM

Page 39: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Auto Layout

Page 40: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Auto Layout

How views are placed in user interface

Page 41: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Auto Layout

How views are placed in user interface

Changes size and placement of views as content changes

Page 42: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Auto Layout

How views are placed in user interface

Changes size and placement of views as content changes

Specify relationships between views using constraints

Page 43: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications
Page 44: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Fixed Width

Page 45: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Fixed Width

Fixed to Edges

Page 46: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Fixed Width

Fixed Width

Fixed to Edges

Page 47: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Same Width

Fixed Width

Fixed Width

Fixed to Edges

Page 48: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Same Width

Fixed Width

Fixed Width

Fixed to Edges

Left Aligned

Page 49: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications
Page 50: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Auto Layout

Allows flexibility as design changes

Page 51: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Auto Layout

Allows flexibility as design changes

Simplifies localization

Page 52: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Auto Layout

Allows flexibility as design changes

Simplifies localization

Xcode has rich interface for working with Auto Layout • Adding new constraints

• Understanding how constraints interact

• Previewing results

• Debugging issues

Page 53: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Related Sessions

• Taking Control of Auto Layout in Xcode 5 WWDC 2013

Page 54: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Documents and Data

Page 55: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Documents and Data

The reason to use your app

Page 56: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Documents and Data

The reason to use your app

Deciding how to store data will drive design

Page 57: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Documents and Data

The reason to use your app

Deciding how to store data will drive design

Two major kinds of data storage in a Cocoa app • Shoebox

• Document-based

Page 58: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Shoebox Apps

Page 59: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Shoebox Apps

Store data in library or container • Usually hidden from user

Page 60: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Shoebox Apps

Store data in library or container • Usually hidden from user

Presents data in single window

Page 61: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Shoebox Apps

Store data in library or container • Usually hidden from user

Presents data in single window

Great for mix and match of data

Page 62: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Shoebox Apps

Store data in library or container • Usually hidden from user

Presents data in single window

Great for mix and match of data

Cocoa provides Core Data

Page 63: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Core Data

Page 64: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Core Data

Generalized object graph and persistence framework

Page 65: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Core Data

Generalized object graph and persistence framework

Efficient performance

Page 66: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Core Data

Generalized object graph and persistence framework

Efficient performance

Change tracking and undo

Page 67: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Core Data

Generalized object graph and persistence framework

Efficient performance

Change tracking and undo

Relationship maintenance

Page 68: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Core Data

Generalized object graph and persistence framework

Efficient performance

Change tracking and undo

Relationship maintenance

Schema migration

Page 69: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Core Data

Generalized object graph and persistence framework

Efficient performance

Change tracking and undo

Relationship maintenance

Schema migration

Query compilation

Page 70: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Related Sessions

• What’s New in Core Data Pacific Heights Thursday 9:00AM

Page 71: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Document-Based Apps

Page 72: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Document-Based Apps

Stores user data in named file container

Page 73: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Document-Based Apps

Stores user data in named file container

Documents may be local or in iCloud

Page 74: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Document-Based Apps

Stores user data in named file container

Documents may be local or in iCloud

Documents are not generally related to each other

Page 75: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Document-Based Apps

Stores user data in named file container

Documents may be local or in iCloud

Documents are not generally related to each other

Users are interested in a few at a time

Page 76: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Document-Based Apps

Stores user data in named file container

Documents may be local or in iCloud

Documents are not generally related to each other

Users are interested in a few at a time

Cocoa provides a document architecture

Page 77: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Cocoa Document Architecture

Page 78: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Cocoa Document Architecture

Provides core features with little or no additional code • Auto Save and Versions

• iCloud

• Asynchronous reading and writing

• Undo

Page 79: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Cocoa Document Architecture

Provides core features with little or no additional code • Auto Save and Versions

• iCloud

• Asynchronous reading and writing

• Undo

Customizable to your app’s needs

Page 80: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Cocoa Document Architecture

Provides core features with little or no additional code • Auto Save and Versions

• iCloud

• Asynchronous reading and writing

• Undo

Customizable to your app’s needs

Start by subclassing NSDocument • Creates, presents, and stores document data

Page 81: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

NSDocumentSubclass and enable iCloud, Auto Save, and Versions

Page 82: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

NSDocumentSubclass and enable iCloud, Auto Save, and Versions

class ListDocument : NSDocument {

Page 83: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

NSDocumentSubclass and enable iCloud, Auto Save, and Versions

class ListDocument : NSDocument { // Default is an empty list var list = List()

Page 84: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

NSDocumentSubclass and enable iCloud, Auto Save, and Versions

class ListDocument : NSDocument { // Default is an empty list var list = List() override class func autosavesInPlace() -> Bool { return true }

Page 85: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

NSDocumentProvide data to be stored on disk

override func dataOfType(typeName: String, error outError: NSErrorPointer) -> NSData? {}

Page 86: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

NSDocumentProvide data to be stored on disk

override func dataOfType(typeName: String, error outError: NSErrorPointer) -> NSData? { if let data = NSKeyedArchiver.archivedDataWithRootObject(list) { return data } }

Page 87: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

NSDocumentProvide data to be stored on disk

override func dataOfType(typeName: String, error outError: NSErrorPointer) -> NSData? { if let data = NSKeyedArchiver.archivedDataWithRootObject(list) { return data } // Set error here return nil;}

Page 88: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

NSDocumentCreate document from data on disk

override func readFromData(data: NSData, ofType typeName: String, error outError: NSErrorPointer) -> Bool { }

Page 89: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

NSDocumentCreate document from data on disk

override func readFromData(data: NSData, ofType typeName: String, error outError: NSErrorPointer) -> Bool { if let deserializedList = NSKeyedUnarchiver.unarchiveObjectWithData(data) as? List { } else { } }

Page 90: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

NSDocumentCreate document from data on disk

override func readFromData(data: NSData, ofType typeName: String, error outError: NSErrorPointer) -> Bool { if let deserializedList = NSKeyedUnarchiver.unarchiveObjectWithData(data) as? List { list = deserializedList return true } else { } }

Page 91: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

NSDocumentCreate document from data on disk

override func readFromData(data: NSData, ofType typeName: String, error outError: NSErrorPointer) -> Bool { if let deserializedList = NSKeyedUnarchiver.unarchiveObjectWithData(data) as? List { list = deserializedList return true } else { // Set error here return false } }

Page 92: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Related Sessions

• Auto Save and Versions in Mac OS X 10.7 Lion WWDC 2011

Page 93: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Other User Data

Page 94: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Other User Data

Preferences—NSUserDefaults • Application preferences

• System preferences

- Language

- Locale

Page 95: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Other User Data

Preferences—NSUserDefaults • Application preferences

• System preferences

- Language

- Locale

Network—NSURLSession

Page 96: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Other User Data

Preferences—NSUserDefaults • Application preferences

• System preferences

- Language

- Locale

Network—NSURLSession

iCloud key-value store—NSUbiquitousKeyValueStore • Small amounts of data, available on all iCloud devices

Page 97: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Other User Data

Preferences—NSUserDefaults • Application preferences

• System preferences

- Language

- Locale

Network—NSURLSession

iCloud key-value store—NSUbiquitousKeyValueStore • Small amounts of data, available on all iCloud devices

CloudKit

Page 98: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

DemoGetting started in Lister

Alex Migicovsky Developer Publications Engineer

Page 99: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Adding More Features

Page 100: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Auto Localization

Page 101: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Auto Localization

Built on top of Auto Layout

Page 102: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Auto Localization

Built on top of Auto Layout

Shares the same UI design but replaces the strings

Page 103: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Auto Localization

Built on top of Auto Layout

Shares the same UI design but replaces the strings

Resizes views appropriately when words are different lengths

Page 104: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Auto Localization

Built on top of Auto Layout

Shares the same UI design but replaces the strings

Resizes views appropriately when words are different lengths

Support both left to right and right to left

Page 105: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications
Page 106: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications
Page 107: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications
Page 108: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Application Bundle Layout

Lister.app/ Contents/ Resources/

Page 109: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Application Bundle Layout

Lister.app/ Contents/ Resources/

Base.lproj/ Main.storyboardc UI, development language

Page 110: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Application Bundle Layout

Lister.app/ Contents/ Resources/

Base.lproj/ Main.storyboardc UI, development language

es.lproj/ Main.strings Spanish strings

Page 111: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Strings File

"key" = "value";

Page 112: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Strings File

"9eV-3V-M02.title" = "Artstay:";

Page 113: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Strings File

"9eV-3V-M02.title" = "Artstay:";

Page 114: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Strings File

"9eV-3V-M02.title" = "Artstay:";

Page 115: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Strings File

"9eV-3V-M02.title" = "Artstay:";

Page 116: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Strings File

"9eV-3V-M02.title" = "Artstay:"; !

"P3b-i2-9LW.title" = "Endway:";

Page 117: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Handoff

Start working on one device and continue on another

Page 118: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Handoff

Start working on one device and continue on another

Support is built in to NSDocument and UIDocument

Page 119: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Handoff

Start working on one device and continue on another

Support is built in to NSDocument and UIDocument

Requires only a small amount of code to enable

Page 120: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Info.plist

Page 121: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Info.plist

Page 122: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Info.plist

Page 123: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Handoff

Lower-level API—NSUserActivity • Native app to web app

• Web app to native app

• Provide additional state beyond document content

• Send custom data using streams

Page 124: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Related Sessions

• Adopting Handoff on iOS and OS X Mission Wednesday 2:00PM

Page 125: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Sharing

Provide a way to share with social networks • Twitter

• Facebook

• …and more

• Single sign-on

Page 126: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Sharing

Provide a way to share with social networks • Twitter

• Facebook

• …and more

• Single sign-on

Integration with extensions from other applications

Page 127: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications
Page 128: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications
Page 129: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

NSSharingServicePicker

Page 130: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

NSSharingServicePicker

Shares NSImage, NSURL, NSString, NSAttributedString

Page 131: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

NSSharingServicePicker

Shares NSImage, NSURL, NSString, NSAttributedString

Two steps to sharing • Put a share button in your app

• Present the picker and specify the data to share

Page 132: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

NSSharingServicePicker

- (IBAction)shareIt:(NSButton *)sender {}

Page 133: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

NSSharingServicePicker

- (IBAction)shareIt:(NSButton *)sender { NSString *greeting = @"Hello, world!";}

Page 134: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

NSSharingServicePicker

- (IBAction)shareIt:(NSButton *)sender { NSString *greeting = @"Hello, world!"; NSSharingServicePicker *picker = [[NSSharingServicePicker alloc] initWithItems:@[greeting]];}

Page 135: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

NSSharingServicePicker

- (IBAction)shareIt:(NSButton *)sender { NSString *greeting = @"Hello, world!"; NSSharingServicePicker *picker = [[NSSharingServicePicker alloc] initWithItems:@[greeting]]; [picker showRelativeToRect:NSZeroRect ofView:sender preferredEdge:NSMinYEdge];}

Page 136: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

More About Sharing

Your app can provide extensions too • Action

• Finder

• Sharing

• Today

Page 137: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Related Sessions

• Creating Extensions for iOS and OS X, Part 1 Mission Tuesday 2:00PM

• Creating Extensions for iOS and OS X, Part 2 Mission Wednesday 11:30AM

• Integrating with Facebook, Twitter, and Sina Weibo

WWDC 2012

Page 138: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

DemoSharing in Lister

!

Alex Migicovsky Developer Publications Engineer

Page 139: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

What to Do Next

Page 140: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Adding More Features

Feature Cocoa Class

Undo NSUndoManager

Drag & Drop, Copy & Paste NSPasteboard

Printing NSPrinting

Page 141: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Adding More Features

Feature Cocoa Class

Undo NSUndoManager

Drag & Drop, Copy & Paste NSPasteboard

Printing NSPrinting

Page 142: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Adding More Features

Feature Cocoa Class

Undo NSUndoManager

Drag & Drop, Copy & Paste NSPasteboard

Printing NSPrinting

Page 143: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Adding More Features

Feature Cocoa Class

Undo NSUndoManager

Drag & Drop, Copy & Paste NSPasteboard

Printing NSPrinting

Page 144: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Adding More Features

Energy efficiency

Page 145: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Adding More Features

Energy efficiency

Three key rules for better battery life • Stay idle as long as possible

• Avoid unnecessary work

• Return to idle as quickly as possible

Page 146: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Related Sessions

• Writing Energy Efficient Code, Part 1 Russian Hill Wednesday 10:15AM

Page 147: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Adding More Features

Feature Cocoa Class

Full screen NSWindow

Resume NSWindowRestoration

Progress reporting NSProgress

Gestures NSGestureRecognizer

Accessibility NSAccessibility

Page 148: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Adding More Features

Feature Cocoa Class

Full screen NSWindow

Resume NSWindowRestoration

Progress reporting NSProgress

Gestures NSGestureRecognizer

Accessibility NSAccessibility

Page 149: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Adding More Features

Feature Cocoa Class

Full screen NSWindow

Resume NSWindowRestoration

Progress reporting NSProgress

Gestures NSGestureRecognizer

Accessibility NSAccessibility

Page 150: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Adding More Features

Feature Cocoa Class

Full screen NSWindow

Resume NSWindowRestoration

Progress reporting NSProgress

Gestures NSGestureRecognizer

Accessibility NSAccessibility

Page 151: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Adding More Features

Feature Cocoa Class

Full screen NSWindow

Resume NSWindowRestoration

Progress reporting NSProgress

Gestures NSGestureRecognizer

Accessibility NSAccessibility

Page 152: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Adding More Features

Feature Cocoa Class

Full screen NSWindow

Resume NSWindowRestoration

Progress reporting NSProgress

Gestures NSGestureRecognizer

Accessibility NSAccessibility

Page 153: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Summary

Page 154: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Summary

Get started with a great foundation

Page 155: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Summary

Get started with a great foundation

Take advantage of the features the frameworks provide

Page 156: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Summary

Get started with a great foundation

Take advantage of the features the frameworks provide

Your app will be in great shape for the future

Page 157: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

More Information

Jake Behrens App Frameworks Evangelist [email protected]

Documentation Start Developing Mac Apps Today http://developer.apple.com

Lister https://developer.apple.com/library/ios/lister_objchttps://developer.apple.com/library/ios/lister_swifthttps://developer.apple.com/library/mac/lister_objchttps://developer.apple.com/library/mac/lister_swift

Apple Developer Forums http://devforums.apple.com

Page 158: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Related Sessions

• Accessibility on OS X Russian Hill Tuesday 2:00PM

• Full Screen and Aqua Changes WWDC 2011

• Resume and Automatic Termination in Lion WWDC 2011

Page 159: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications

Labs

• View Controllers and Cocoa Lab Frameworks Lab B Thursday 11:30AM

• Extensions Lab Frameworks Lab B Thursday 2:00PM

• Cocoa Lab Frameworks Lab B Thursday 4:30PM

Page 160: 227 Creating Modern Cocoa Apps DF - Apple Inc. · NSString *greeting = @"Hello, world!"; ... and Sina Weibo WWDC 2012. Demo Sharing in Lister! Alex Migicovsky Developer Publications