what’s new in cocoa...storyboard new classes • nsstoryboard • nsstoryboardsegue new protocol...
TRANSCRIPT
![Page 1: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/1.jpg)
© 2014 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple.
#WWDC14
What’s New in Cocoa
Session 204 Ali Ozer Director of Cocoa Frameworks
Frameworks
![Page 2: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/2.jpg)
Agenda
High-level coverage of changes in Cocoa in Yosemite
Pointers to related sessions
![Page 3: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/3.jpg)
New Look
Extensions
Handoff
Storyboards and View Controllers
API Modernization
Swift
And others…
Topics
![Page 4: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/4.jpg)
New Look
Extensions
Handoff
Storyboards and View Controllers
API Modernization
Swift
And others…
Topics
![Page 5: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/5.jpg)
New Look
![Page 6: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/6.jpg)
New Look
Updated look for controls
Translucency
Vibrancy
New window styles
New font
!
![Page 7: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/7.jpg)
Updated Look for Controls
![Page 8: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/8.jpg)
Updated Look for Controls
Mavericks
![Page 9: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/9.jpg)
Updated Look for Controls
Mavericks Yosemite
![Page 10: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/10.jpg)
Mavericks Yosemite
![Page 11: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/11.jpg)
Mavericks Yosemite
![Page 12: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/12.jpg)
![Page 13: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/13.jpg)
![Page 14: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/14.jpg)
Updated Look for Controls
![Page 15: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/15.jpg)
Automatic!
![Page 16: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/16.jpg)
Translucency
Transparency + Blur
![Page 17: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/17.jpg)
![Page 18: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/18.jpg)
![Page 19: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/19.jpg)
![Page 20: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/20.jpg)
![Page 21: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/21.jpg)
![Page 22: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/22.jpg)
![Page 23: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/23.jpg)
![Page 24: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/24.jpg)
Translucency
Automatic in many cases • Sheets, menus, popovers
• Source lists
• Titlebars/toolbars
![Page 25: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/25.jpg)
NSWindowTranslucent Titlebar/Toolbar
Automatic for any NSScrollView next to title bar
!
![Page 26: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/26.jpg)
NSWindowTranslucent Titlebar/Toolbar
For other cases, use new style NSFullSizeContentViewWindowMask
![Page 27: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/27.jpg)
NSWindowTranslucent Titlebar/Toolbar
For other cases, use new style NSFullSizeContentViewWindowMask
Further customize the title bar with titleVisibility and titlebarAppearsTransparent
![Page 28: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/28.jpg)
NSWindowTranslucent Titlebar/Toolbar
For other cases, use new style NSFullSizeContentViewWindowMask
Further customize the title bar with titleVisibility and titlebarAppearsTransparent
![Page 29: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/29.jpg)
![Page 30: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/30.jpg)
Vibrancy
![Page 31: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/31.jpg)
Vibrancy
![Page 32: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/32.jpg)
Vibrancy
![Page 33: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/33.jpg)
Vibrancy
![Page 34: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/34.jpg)
Vibrancy
Automatic in contexts where we apply translucency • For controls and other NSViews when appropriate
![Page 35: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/35.jpg)
VibrancyEnabling it explicitly
![Page 36: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/36.jpg)
VibrancyEnabling it explicitly
Create a top-level NSVisualEffectView • Specify in-window or behind-window translucency with blendingMode
![Page 37: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/37.jpg)
VibrancyEnabling it explicitly
Create a top-level NSVisualEffectView • Specify in-window or behind-window translucency with blendingMode
Specify a vibrant appearance • NSAppearanceNameVibrantLight or NSAppearanceNameVibrantDark
![Page 38: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/38.jpg)
VibrancyEnabling it explicitly
Create a top-level NSVisualEffectView • Specify in-window or behind-window translucency with blendingMode
Specify a vibrant appearance • NSAppearanceNameVibrantLight or NSAppearanceNameVibrantDark
Populate with vibrant-capable controls • Such controls return YES from allowsVibrancy • Some controls opt-in to vibrancy dynamically
![Page 39: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/39.jpg)
![Page 40: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/40.jpg)
NSImageView with template image
![Page 41: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/41.jpg)
NSImageView with template image
NSImageView with regular image
![Page 42: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/42.jpg)
NSImageView with template image
NSImageView with regular image
![Page 43: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/43.jpg)
NSImageView with template image
NSImageView with regular image
![Page 44: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/44.jpg)
NSColor
Existing system colors have been updated • And many have appearance-specific variants
![Page 45: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/45.jpg)
NSColor
Existing system colors have been updated • And many have appearance-specific variants
![Page 46: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/46.jpg)
NSColor
Existing system colors have been updated • And many have appearance-specific variants
![Page 47: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/47.jpg)
NSColor
Existing system colors have been updated • And many have appearance-specific variants
Text color = [NSColor secondaryLabelColor];
![Page 48: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/48.jpg)
New Font
![Page 49: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/49.jpg)
New Font
Helvetica Neue optimized for OS X • Metrics similar to Lucida
![Page 50: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/50.jpg)
New Font
Helvetica Neue optimized for OS X • Metrics similar to Lucida
Obtain via methods such as systemFontOfSize:
![Page 51: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/51.jpg)
New Font
Helvetica Neue optimized for OS X • Metrics similar to Lucida
Obtain via methods such as systemFontOfSize:
In applications linked against 10.9 SDK and earlier • Explicit references to Lucida Grande in UI elements will be replaced at runtime
• Text will be compressed if too tight
![Page 52: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/52.jpg)
NSSegmentedControl
New style for back/forward buttons, NSSegmentStyleSeparated
![Page 53: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/53.jpg)
NSSegmentedControl
New style for back/forward buttons, NSSegmentStyleSeparated
![Page 54: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/54.jpg)
NSSegmentedControl
New style for back/forward buttons, NSSegmentStyleSeparated
![Page 55: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/55.jpg)
Related Sessions
• Adapting Your App to the New UI of OS X Yosemite
Pacific Heights Tuesday 3:15PM
• Adopting Advanced Features of the New UI Marina Wednesday 2:00PM
![Page 56: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/56.jpg)
Labs
• Cocoa Lab Frameworks Lab B Tuesday 12:30PM
• New UI and Cocoa Lab Frameworks Lab B Wednesday 3:15PM
![Page 57: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/57.jpg)
Extensions
![Page 58: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/58.jpg)
Extensions
Provide access to your app’s functionality and content in other apps
![Page 59: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/59.jpg)
Extensions
Provide access to your app’s functionality and content in other apps• Run in a separate process from the app in which they’re invoked
![Page 60: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/60.jpg)
Extensions
Provide access to your app’s functionality and content in other apps• Run in a separate process from the app in which they’re invoked
Are delivered with apps as distinct bundles within the app bundle
![Page 61: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/61.jpg)
![Page 62: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/62.jpg)
![Page 63: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/63.jpg)
![Page 64: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/64.jpg)
![Page 65: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/65.jpg)
![Page 66: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/66.jpg)
Extensions
NSExtensionContext
NSExtensionItem
NSItemProvider
![Page 67: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/67.jpg)
Inside the Extension
![Page 68: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/68.jpg)
Principal class
Inside the Extension
![Page 69: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/69.jpg)
Principal class
NSExtensionContext
Inside the Extension
![Page 70: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/70.jpg)
Principal class
NSExtensionContext
NSExtensionItem NSExtensionItem
Inside the Extension
![Page 71: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/71.jpg)
Principal class
NSExtensionContext
NSExtensionItem NSExtensionItem
NSItemProviderNSItemProvider
Inside the Extension
![Page 72: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/72.jpg)
NSExtensionContext
![Page 73: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/73.jpg)
NSExtensionContext
Get the data to be worked on from the instance of the principal class NSArray *extensionItems = self.extensionContext.inputItems;
![Page 74: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/74.jpg)
NSExtensionContext
Get the data to be worked on from the instance of the principal class NSArray *extensionItems = self.extensionContext.inputItems;
When done, return the results NSArray *processedItems = << array of NSExtensionItem >> ; [self.extensionContext completeRequestReturningItems:processedItems completionHandler:nil];
![Page 75: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/75.jpg)
NSExtensionContext
Get the data to be worked on from the instance of the principal class NSArray *extensionItems = self.extensionContext.inputItems;
When done, return the results NSArray *processedItems = << array of NSExtensionItem >> ; [self.extensionContext completeRequestReturningItems:processedItems completionHandler:nil];
Or indicate error/cancellation [self.extensionContext cancelRequestWithError:error];
![Page 76: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/76.jpg)
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
![Page 77: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/77.jpg)
Labs
• Extensions Lab Frameworks Lab A Tuesday 3:15PM
• Extensions Lab Frameworks Lab B Thursday 2:00PM
![Page 78: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/78.jpg)
Handoff
![Page 79: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/79.jpg)
Handoff
Enables users to seamlessly transition activities between devices
![Page 80: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/80.jpg)
Handoff
Enables users to seamlessly transition activities between devices
Simple base API • NSUserActivity
![Page 81: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/81.jpg)
Handoff
Enables users to seamlessly transition activities between devices
Simple base API • NSUserActivity
Related API • NSApplication
• NSDocument
• NSResponder
![Page 82: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/82.jpg)
NSUserActivity
Encapsulates hand-off information about a single user activity
![Page 83: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/83.jpg)
NSUserActivity
Encapsulates hand-off information about a single user activityNSUserActivity *activity = [[NSUserActivity alloc] initWithActivityType:@"com.company.somegame.playing"];
![Page 84: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/84.jpg)
NSUserActivity
Encapsulates hand-off information about a single user activityNSUserActivity *activity = [[NSUserActivity alloc] initWithActivityType:@"com.company.somegame.playing"];activity.userInfo = @{@"Level":@1, @"Location":@"Start", @"Score":@0};
![Page 85: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/85.jpg)
NSUserActivity
Encapsulates hand-off information about a single user activityNSUserActivity *activity = [[NSUserActivity alloc] initWithActivityType:@"com.company.somegame.playing"];activity.userInfo = @{@"Level":@1, @"Location":@"Start", @"Score":@0};activity.title = @"Playing Some Game”;
![Page 86: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/86.jpg)
NSUserActivity
Encapsulates hand-off information about a single user activityNSUserActivity *activity = [[NSUserActivity alloc] initWithActivityType:@"com.company.somegame.playing"];activity.userInfo = @{@"Level":@1, @"Location":@"Start", @"Score":@0};activity.title = @"Playing Some Game”;
[activity becomeCurrent];
![Page 87: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/87.jpg)
NSApplication
Controls continuation of user activities
!
- (BOOL)application:(NSApplication *)application willContinueUserActivityWithType:(NSString *)type; !
- (BOOL)application:(NSApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void(^)(NSArray *restorableObjects))handler;
![Page 88: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/88.jpg)
NSDocumentEasy handoff support for iCloud documents
Add to Info.plist <key>CFBundleDocumentTypes</key>
<array> <dict> … <key>NSUbiquitousDocumentUserActivityType</key> <string>com.apple.TextEdit.editing</string> </dict> </array> !
Access the userActivity object via @property (strong) NSUserActivity *userActivity;
![Page 89: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/89.jpg)
Related Sessions
• Adopting Handoff on iOS and OS X Mission Wednesday 2:00PM
![Page 90: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/90.jpg)
Labs
• Handoff Lab Frameworks Lab B Thursday 9:00AM
![Page 91: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/91.jpg)
Storyboards and View Controllers
![Page 92: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/92.jpg)
StoryboardNow on OS X
Visual representation of the user interface
![Page 93: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/93.jpg)
![Page 94: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/94.jpg)
![Page 95: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/95.jpg)
Storyboard
Specify the different parts of your UI as different scenes
Use segues to connect or transition between them
![Page 96: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/96.jpg)
Storyboard
New classes • NSStoryboard
• NSStoryboardSegue
![Page 97: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/97.jpg)
Storyboard
New classes • NSStoryboard
• NSStoryboardSegue
New protocol • NSSeguePerforming
![Page 98: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/98.jpg)
Storyboard
New classes • NSStoryboard
• NSStoryboardSegue
New protocol • NSSeguePerforming
New APIs on NSViewController, NSWindowController • NSSeguePerforming conformance
• Access to storyboard
![Page 99: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/99.jpg)
New View Controllers
NSTabViewController
NSSplitViewController
![Page 100: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/100.jpg)
NSTabViewController
![Page 101: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/101.jpg)
NSTabViewController
NSTabViewController
![Page 102: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/102.jpg)
NSTabViewController
NSTabViewController
NSTabViewItem NSTabViewItem
tabViewItems
![Page 103: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/103.jpg)
NSTabViewController
NSTabViewController
NSTabViewItem NSTabViewItem
NSViewController NSViewController
tabViewItems
viewController viewController
![Page 104: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/104.jpg)
NSTabViewController
NSTabViewItem NSTabViewItem
NSViewController NSViewController
tabViewItems
viewController viewController
![Page 105: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/105.jpg)
NSTabViewController
NSTabViewItem NSTabViewItem
NSViewController NSViewController
tabViewItems
viewController viewController
![Page 106: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/106.jpg)
To add a child-view controller
NSTabViewController
NSTabViewItem NSTabViewItem
NSViewController NSViewController
tabViewItems
viewController viewController
![Page 107: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/107.jpg)
To add a child-view controllerNSTabViewItem *item = [NSTabViewItem tabViewItemWithViewController:child];
NSTabViewController
NSTabViewItem NSTabViewItem
NSViewController NSViewController
tabViewItems
viewController viewController
![Page 108: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/108.jpg)
To add a child-view controllerNSTabViewItem *item = [NSTabViewItem tabViewItemWithViewController:child];
NSTabViewController
NSTabViewItem NSTabViewItem
NSViewController NSViewController
tabViewItems
viewController viewController
![Page 109: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/109.jpg)
To add a child-view controllerNSTabViewItem *item = [NSTabViewItem tabViewItemWithViewController:child];item.label = @“Tab Label”; // Configure item as needed
NSTabViewController
NSTabViewItem NSTabViewItem
NSViewController NSViewController
tabViewItems
viewController viewController
![Page 110: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/110.jpg)
To add a child-view controllerNSTabViewItem *item = [NSTabViewItem tabViewItemWithViewController:child];item.label = @“Tab Label”; // Configure item as needed[tabViewController addTabViewItem:item];
NSTabViewController
NSTabViewItem NSTabViewItem
NSViewController NSViewController
tabViewItems
viewController viewController
![Page 111: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/111.jpg)
To add a child-view controllerNSTabViewItem *item = [NSTabViewItem tabViewItemWithViewController:child];item.label = @“Tab Label”; // Configure item as needed[tabViewController addTabViewItem:item];
or[tabViewController addChildViewController:child];
NSTabViewController
NSTabViewItem NSTabViewItem
NSViewController NSViewController
tabViewItems
viewController viewController
![Page 112: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/112.jpg)
To add a child-view controllerNSTabViewItem *item = [NSTabViewItem tabViewItemWithViewController:child];item.label = @“Tab Label”; // Configure item as needed[tabViewController addTabViewItem:item];
or[tabViewController addChildViewController:child];
NSTabViewController
NSTabViewItem NSTabViewItem
NSViewController NSViewController
tabViewItems
viewController viewController
![Page 113: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/113.jpg)
To add a child-view controllerNSTabViewItem *item = [NSTabViewItem tabViewItemWithViewController:child];item.label = @“Tab Label”; // Configure item as needed[tabViewController addTabViewItem:item];
or[tabViewController addChildViewController:child];
NSTabViewController
NSTabViewItem NSTabViewItem
NSViewController NSViewController
tabViewItems
viewController viewController
![Page 114: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/114.jpg)
To add a child-view controllerNSTabViewItem *item = [NSTabViewItem tabViewItemWithViewController:child];item.label = @“Tab Label”; // Configure item as needed[tabViewController addTabViewItem:item];
or[tabViewController addChildViewController:child];
NSTabViewController
NSTabViewItem NSTabViewItem
NSViewController NSViewController
tabViewItems
viewController viewController
![Page 115: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/115.jpg)
To add a child-view controllerNSTabViewItem *item = [NSTabViewItem tabViewItemWithViewController:child];item.label = @“Tab Label”; // Configure item as needed[tabViewController addTabViewItem:item];
or[tabViewController addChildViewController:child];
// If needed, to configure the child tabViewItem further:item = [tabViewController tabViewItemForViewController:child];
NSTabViewController
NSTabViewItem NSTabViewItem
NSViewController NSViewController
tabViewItems
viewController viewController
![Page 116: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/116.jpg)
To add a child-view controllerNSTabViewItem *item = [NSTabViewItem tabViewItemWithViewController:child];item.label = @“Tab Label”; // Configure item as needed[tabViewController addTabViewItem:item];
or[tabViewController addChildViewController:child];
// If needed, to configure the child tabViewItem further:item = [tabViewController tabViewItemForViewController:child];item.label = @“Tab Label”;
NSTabViewController
NSTabViewItem NSTabViewItem
NSViewController NSViewController
tabViewItems
viewController viewController
![Page 117: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/117.jpg)
To add a child-view controllerNSTabViewItem *item = [NSTabViewItem tabViewItemWithViewController:child];item.label = @“Tab Label”; // Configure item as needed[tabViewController addTabViewItem:item];
or[tabViewController addChildViewController:child];
// If needed, to configure the child tabViewItem further:item = [tabViewController tabViewItemForViewController:child];item.label = @“Tab Label”;
NSTabViewController
NSTabViewItem NSTabViewItem
NSViewController NSViewController
tabViewItems
viewController viewController
![Page 118: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/118.jpg)
NSSplitViewController
![Page 119: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/119.jpg)
NSSplitViewController
NSSplitViewController
![Page 120: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/120.jpg)
NSSplitViewController
NSSplitViewController
NSSplitViewItem NSSplitViewItem
splitViewItems
![Page 121: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/121.jpg)
NSSplitViewController
NSSplitViewController
NSSplitViewItem NSSplitViewItem
NSViewController NSViewController
splitViewItems
viewController viewController
![Page 122: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/122.jpg)
NSSplitViewController
To add a child-view controller NSSplitViewItem *item = [NSSplitViewItem splitViewItemWithViewController:child]; item.canCollapse = YES; // initialize item as needed [splitViewController addSplitViewItem:item];
NSSplitViewController
NSSplitViewItem NSSplitViewItem
NSViewController NSViewController
splitViewItems
viewController viewController
![Page 123: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/123.jpg)
NSSplitViewController
To add a child-view controller NSSplitViewItem *item = [NSSplitViewItem splitViewItemWithViewController:child]; item.canCollapse = YES; // initialize item as needed [splitViewController addSplitViewItem:item];
or [splitViewController addChildViewController:child];
NSSplitViewController
NSSplitViewItem NSSplitViewItem
NSViewController NSViewController
splitViewItems
viewController viewController
![Page 124: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/124.jpg)
View Controller Presentation
![Page 125: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/125.jpg)
View Controller Presentation
- (void)presentViewControllerAsSheet:(NSViewController *)controller;
![Page 126: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/126.jpg)
View Controller Presentation
- (void)presentViewControllerAsSheet:(NSViewController *)controller;
- (void)presentViewControllerAsModalWindow:(NSViewController *)controller;
![Page 127: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/127.jpg)
View Controller Presentation
- (void)presentViewControllerAsSheet:(NSViewController *)controller;
- (void)presentViewControllerAsModalWindow:(NSViewController *)controller;
- (void)presentViewController:(NSViewController *)controller asPopoverRelativeToRect:(NSRect)positioningRect ofView:(NSView *)positioningView preferredEdge:(NSRectEdge)preferredEdge behavior:(NSPopoverBehavior)behavior;
![Page 128: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/128.jpg)
View Controller Presentation
- (void)presentViewControllerAsSheet:(NSViewController *)controller;
- (void)presentViewControllerAsModalWindow:(NSViewController *)controller;
- (void)presentViewController:(NSViewController *)controller asPopoverRelativeToRect:(NSRect)positioningRect ofView:(NSView *)positioningView preferredEdge:(NSRectEdge)preferredEdge behavior:(NSPopoverBehavior)behavior;
- (void)dismissViewController:(NSViewController *)controller;
![Page 129: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/129.jpg)
View Controller Presentation
- (void)transitionFromViewController:(NSViewController *)source toViewController:(NSViewController *)dest options:(NSViewControllerTransitionOptions)opts completionHandler:(void (^)(void))completion;
![Page 130: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/130.jpg)
View Controller Presentation
- (void)viewDidLoad;
![Page 131: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/131.jpg)
View Controller Presentation
- (void)viewDidLoad;
- (void)viewWillAppear;- (void)viewDidAppear;- (void)viewWillDisappear;- (void)viewDidDisappear;
![Page 132: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/132.jpg)
View Controller Presentation
- (void)viewDidLoad;
- (void)viewWillAppear;- (void)viewDidAppear;- (void)viewWillDisappear;- (void)viewDidDisappear;
- (void)viewWillLayout;- (void)viewDidLayout;
![Page 133: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/133.jpg)
View Controller
![Page 134: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/134.jpg)
View Controller
Now automatically added into the responder chain• View controller’s next responder is set to that of its view
• View controller becomes the next responder of the view
![Page 135: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/135.jpg)
View Controller
Now automatically added into the responder chain• View controller’s next responder is set to that of its view
• View controller becomes the next responder of the view
View
![Page 136: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/136.jpg)
View Controller
Now automatically added into the responder chain• View controller’s next responder is set to that of its view
• View controller becomes the next responder of the view
Window’s WindowControllerView ParentView Window
![Page 137: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/137.jpg)
View Controller
Now automatically added into the responder chain• View controller’s next responder is set to that of its view
• View controller becomes the next responder of the view
Child View Window’s WindowControllerView ParentView Window
![Page 138: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/138.jpg)
View Controller
Now automatically added into the responder chain• View controller’s next responder is set to that of its view
• View controller becomes the next responder of the view
Child View Window’s WindowControllerView ParentView Window
View’s ViewController
![Page 139: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/139.jpg)
View Controller
Now automatically added into the responder chain• View controller’s next responder is set to that of its view
• View controller becomes the next responder of the view
Child View Window’s WindowControllerView ParentView Window
View’s ViewController
![Page 140: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/140.jpg)
View Controller
Now automatically added into the responder chain• View controller’s next responder is set to that of its view
• View controller becomes the next responder of the view
This change is effective only in apps built against the 10.10 SDK
Child View Window’s WindowControllerView ParentView Window
View’s ViewController
![Page 141: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/141.jpg)
Related Sessions
• Storyboards and Controllers on OS X Pacific Heights Tuesday 4:30PM
![Page 142: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/142.jpg)
Labs
• View Controllers and Cocoa Lab Frameworks Lab B Thursday 11:30AM
![Page 143: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/143.jpg)
API Modernization
![Page 144: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/144.jpg)
API ModernizationMany advances in Objective-C in recent years
![Page 145: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/145.jpg)
API ModernizationMany advances in Objective-C in recent years
@property
![Page 146: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/146.jpg)
API ModernizationMany advances in Objective-C in recent years
@property
instancetype
![Page 147: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/147.jpg)
API ModernizationMany advances in Objective-C in recent years
@property
instancetype
enums with explicit underlying types, NS_ENUM and NS_OPTIONS
![Page 148: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/148.jpg)
API ModernizationMany advances in Objective-C in recent years
@property
instancetype
enums with explicit underlying types, NS_ENUM and NS_OPTIONS
NS_REQUIRES_SUPER
![Page 149: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/149.jpg)
API ModernizationMany advances in Objective-C in recent years
@property
instancetype
enums with explicit underlying types, NS_ENUM and NS_OPTIONS
NS_REQUIRES_SUPER
And a new one, NS_DESIGNATED_INITIALIZER
![Page 150: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/150.jpg)
API ModernizationMany advances in Objective-C in recent years
@property
instancetype
enums with explicit underlying types, NS_ENUM and NS_OPTIONS
NS_REQUIRES_SUPER
And a new one, NS_DESIGNATED_INITIALIZER
In 10.10 and iOS 8 SDKs, increased adoption of these facilities
![Page 151: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/151.jpg)
API ModernizationWhy?
![Page 152: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/152.jpg)
API ModernizationWhy?
Allow stating the APIs more correctly and precisely
![Page 153: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/153.jpg)
API ModernizationWhy?
Allow stating the APIs more correctly and precisely
This enables• The APIs to be more self-documenting
![Page 154: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/154.jpg)
API ModernizationWhy?
Allow stating the APIs more correctly and precisely
This enables• The APIs to be more self-documenting
• The APIs to be more consistent
![Page 155: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/155.jpg)
API ModernizationWhy?
Allow stating the APIs more correctly and precisely
This enables• The APIs to be more self-documenting
• The APIs to be more consistent
• Xcode to be more helpful
![Page 156: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/156.jpg)
API ModernizationWhy?
Allow stating the APIs more correctly and precisely
This enables• The APIs to be more self-documenting
• The APIs to be more consistent
• Xcode to be more helpful
• The compiler to detect and warn about potential bugs
![Page 157: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/157.jpg)
API ModernizationWhy?
Allow stating the APIs more correctly and precisely
This enables• The APIs to be more self-documenting
• The APIs to be more consistent
• Xcode to be more helpful
• The compiler to detect and warn about potential bugs
• Better exposure of APIs in Swift
![Page 158: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/158.jpg)
API ModernizationWhy?
Allow stating the APIs more correctly and precisely
This enables• The APIs to be more self-documenting
• The APIs to be more consistent
• Xcode to be more helpful
• The compiler to detect and warn about potential bugs
• Better exposure of APIs in Swift
You may see new warnings or errors in your builds
![Page 159: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/159.jpg)
Using @property
![Page 160: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/160.jpg)
Using @property
Many accessors in APIs converted to @property
![Page 161: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/161.jpg)
Using @property
Many accessors in APIs converted to @property
Obvious ones, for instance in NSControl @property (weak) id target; @property (copy) id objectValue;
![Page 162: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/162.jpg)
Using @property
Many accessors in APIs converted to @property
Obvious ones, for instance in NSControl @property (weak) id target; @property (copy) id objectValue;
But also possibly “computed” properties @property NSInteger integerValue; @property (copy) NSString *stringValue; @property (readonly, copy) NSString *description;
![Page 163: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/163.jpg)
Using @property
Many accessors in APIs converted to @property
Obvious ones, for instance in NSControl @property (weak) id target; @property (copy) id objectValue;
But also possibly “computed” properties @property NSInteger integerValue; @property (copy) NSString *stringValue; @property (readonly, copy) NSString *description;
Use @property for anything that is about the value or state of an object or its relationship to other objects
![Page 164: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/164.jpg)
When Not to Use @property
Not every method which can be expressed as a property should be
![Page 165: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/165.jpg)
When Not to Use @property
Not every method which can be expressed as a property should be
![Page 166: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/166.jpg)
When Not to Use @property
Not every method which can be expressed as a property should be
Bad candidates for @property
![Page 167: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/167.jpg)
When Not to Use @property
Not every method which can be expressed as a property should be
Bad candidates for @property• Methods which do things: load, parse, toggle, …
![Page 168: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/168.jpg)
When Not to Use @property
Not every method which can be expressed as a property should be
Bad candidates for @property• Methods which do things: load, parse, toggle, …
- Generally these have a verb prefix on the name
![Page 169: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/169.jpg)
When Not to Use @property
Not every method which can be expressed as a property should be
Bad candidates for @property• Methods which do things: load, parse, toggle, …
- Generally these have a verb prefix on the name
• Generators: init, copy, objectEnumerator
![Page 170: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/170.jpg)
When Not to Use @property
Not every method which can be expressed as a property should be
Bad candidates for @property• Methods which do things: load, parse, toggle, …
- Generally these have a verb prefix on the name
• Generators: init, copy, objectEnumerator
• Methods which change state: nextObject
![Page 171: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/171.jpg)
Weak @property
![Page 172: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/172.jpg)
Weak @property
Use “weak” (zeroing weak) for targets @property (weak) id target;
![Page 173: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/173.jpg)
Weak @property
Use “weak” (zeroing weak) for targets @property (weak) id target;
• Effective only in applications linked against 10.10 SDK
![Page 174: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/174.jpg)
Weak @property
Use “weak” (zeroing weak) for targets @property (weak) id target;
• Effective only in applications linked against 10.10 SDK
Newly introduced delegates and data sources will also be weak @property (weak) id <NSGestureRecognizerDelegate> delegate;
![Page 175: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/175.jpg)
Xcode ModernizerIf you want to modernize your code
![Page 176: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/176.jpg)
Xcode ModernizerIf you want to modernize your code
![Page 177: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/177.jpg)
Xcode ModernizerIf you want to modernize your code
![Page 178: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/178.jpg)
Swift
![Page 179: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/179.jpg)
Swift
A new language for Cocoa
Seamless interoperability with Cocoa APIs and Objective-C code
![Page 180: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/180.jpg)
Cocoa APIs in Swift
Existing API guidelines for Cocoa Objective-C APIs apply to Swift
No changes in APIs as exposed in Swift
!
!
![Page 181: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/181.jpg)
Cocoa Properties in Swift
![Page 182: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/182.jpg)
Cocoa Properties in Swift
@property NSRect frame;
![Page 183: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/183.jpg)
Cocoa Properties in Swift
@property NSRect frame;
var frame : NSRect
![Page 184: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/184.jpg)
Cocoa Properties in Swift
@property NSRect frame;
var frame : NSRect
@property (readonly, strong) NSStoryboard *storyboard;
![Page 185: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/185.jpg)
Cocoa Properties in Swift
@property NSRect frame;
var frame : NSRect
@property (readonly, strong) NSStoryboard *storyboard;
var storyboard : NSStoryboard! { get }
![Page 186: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/186.jpg)
Cocoa Properties in Swift
@property NSRect frame;
var frame : NSRect
@property (readonly, strong) NSStoryboard *storyboard;
var storyboard : NSStoryboard! { get }
@property (copy) NSArray *subviews;
![Page 187: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/187.jpg)
Cocoa Properties in Swift
@property NSRect frame;
var frame : NSRect
@property (readonly, strong) NSStoryboard *storyboard;
var storyboard : NSStoryboard! { get }
@property (copy) NSArray *subviews;
var subviews : AnyObject[]!
![Page 188: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/188.jpg)
Cocoa APIs in SwiftMethods with no arguments
![Page 189: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/189.jpg)
Cocoa APIs in SwiftMethods with no arguments
Declaration- (void)displayIfNeeded;
![Page 190: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/190.jpg)
Cocoa APIs in SwiftMethods with no arguments
Declaration- (void)displayIfNeeded;
func displayIfNeeded()
![Page 191: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/191.jpg)
Cocoa APIs in SwiftMethods with no arguments
Declaration- (void)displayIfNeeded;
func displayIfNeeded()
Invocation
![Page 192: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/192.jpg)
Cocoa APIs in SwiftMethods with no arguments
Declaration- (void)displayIfNeeded;
func displayIfNeeded()
Invocationview.displayIfNeeded()
![Page 193: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/193.jpg)
Cocoa APIs in SwiftMethods with one argument
![Page 194: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/194.jpg)
Cocoa APIs in SwiftMethods with one argument
Declaration- (void)addSubview:(NSView *)aView;
![Page 195: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/195.jpg)
Cocoa APIs in SwiftMethods with one argument
Declaration- (void)addSubview:(NSView *)aView;
func addSubview(aView:NSView?)
![Page 196: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/196.jpg)
Cocoa APIs in SwiftMethods with one argument
Declaration- (void)addSubview:(NSView *)aView;
func addSubview(aView:NSView?)
![Page 197: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/197.jpg)
Cocoa APIs in SwiftMethods with one argument
Declaration- (void)addSubview:(NSView *)aView;
func addSubview(aView:NSView?)
![Page 198: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/198.jpg)
Cocoa APIs in SwiftMethods with one argument
Declaration- (void)addSubview:(NSView *)aView;
func addSubview(aView:NSView?)
Invocation
![Page 199: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/199.jpg)
Cocoa APIs in SwiftMethods with one argument
Declaration- (void)addSubview:(NSView *)aView;
func addSubview(aView:NSView?)
Invocationview.addSubview(anotherView)
![Page 200: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/200.jpg)
Cocoa APIs in SwiftMethods with multiple arguments
![Page 201: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/201.jpg)
Cocoa APIs in SwiftMethods with multiple arguments
Declaration- (void)performSegueWithIdentifier:(NSString)segueID sender:(id)sender;
![Page 202: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/202.jpg)
Cocoa APIs in SwiftMethods with multiple arguments
Declaration- (void)performSegueWithIdentifier:(NSString)segueID sender:(id)sender;
func performSegueWithIdentifier(segueID:String?, sender:AnyObject?)
![Page 203: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/203.jpg)
Cocoa APIs in SwiftMethods with multiple arguments
Declaration- (void)performSegueWithIdentifier:(NSString)segueID sender:(id)sender;
func performSegueWithIdentifier(segueID:String?, sender:AnyObject?)
![Page 204: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/204.jpg)
Cocoa APIs in SwiftMethods with multiple arguments
Declaration- (void)performSegueWithIdentifier:(NSString)segueID sender:(id)sender;
func performSegueWithIdentifier(segueID:String?, sender:AnyObject?)
![Page 205: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/205.jpg)
Cocoa APIs in SwiftMethods with multiple arguments
Declaration- (void)performSegueWithIdentifier:(NSString)segueID sender:(id)sender;
func performSegueWithIdentifier(segueID:String?, sender:AnyObject?)
![Page 206: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/206.jpg)
Cocoa APIs in SwiftMethods with multiple arguments
Declaration- (void)performSegueWithIdentifier:(NSString)segueID sender:(id)sender;
func performSegueWithIdentifier(segueID:String?, sender:AnyObject?)
![Page 207: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/207.jpg)
Cocoa APIs in SwiftMethods with multiple arguments
Declaration- (void)performSegueWithIdentifier:(NSString)segueID sender:(id)sender;
func performSegueWithIdentifier(segueID:String?, sender:AnyObject?)
![Page 208: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/208.jpg)
Cocoa APIs in SwiftMethods with multiple arguments
Declaration- (void)performSegueWithIdentifier:(NSString)segueID sender:(id)sender;
func performSegueWithIdentifier(segueID:String?, sender:AnyObject?)
![Page 209: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/209.jpg)
Cocoa APIs in SwiftMethods with multiple arguments
Declaration- (void)performSegueWithIdentifier:(NSString)segueID sender:(id)sender;
func performSegueWithIdentifier(segueID:String?, sender:AnyObject?)
func performSegueWithIdentifier(String?, sender:AnyObject?)
![Page 210: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/210.jpg)
Cocoa APIs in SwiftMethods with multiple arguments
Declaration- (void)performSegueWithIdentifier:(NSString)segueID sender:(id)sender;
func performSegueWithIdentifier(segueID:String?, sender:AnyObject?)
func performSegueWithIdentifier(String?, sender:AnyObject?)
InvocationviewController.performSegueWithIdentifier(“Next”, sender:nil)
![Page 211: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/211.jpg)
Cocoa APIs in SwiftCocoa APIs omit explicit label on the first argument
![Page 212: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/212.jpg)
Cocoa APIs in SwiftCocoa APIs omit explicit label on the first argument
Name of first argument is part of the base name
![Page 213: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/213.jpg)
Cocoa APIs in SwiftCocoa APIs omit explicit label on the first argument
Name of first argument is part of the base nameviewController.performSegueWithIdentifier(“Next”, sender:nil)
![Page 214: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/214.jpg)
Cocoa APIs in SwiftCocoa APIs omit explicit label on the first argument
Name of first argument is part of the base nameviewController.performSegueWithIdentifier(“Next”, sender:nil)
canCollapse = delegate.splitView(self, canCollapseSubview:subview)
![Page 215: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/215.jpg)
Cocoa APIs in SwiftCocoa APIs omit explicit label on the first argument
Name of first argument is part of the base nameviewController.performSegueWithIdentifier(“Next”, sender:nil)
canCollapse = delegate.splitView(self, canCollapseSubview:subview)
success = url.setResourceValue(value, forKey:NSURLNameKey, error:&err)
![Page 216: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/216.jpg)
Cocoa APIs in SwiftWhen to consider using label on first argument
![Page 217: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/217.jpg)
Cocoa APIs in SwiftWhen to consider using label on first argument
Cases where arguments are “equally weighted” subparts of a whole
![Page 218: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/218.jpg)
Cocoa APIs in SwiftWhen to consider using label on first argument
Cases where arguments are “equally weighted” subparts of a whole
Instead of func moveToX(CGFloat, y:CGFloat)
![Page 219: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/219.jpg)
Cocoa APIs in SwiftWhen to consider using label on first argument
Cases where arguments are “equally weighted” subparts of a whole
Instead of func moveToX(CGFloat, y:CGFloat)
Perhaps func move(x:CGFloat, y:CGFloat), or moveToLocation(x:CGFloat, y:CGFloat)
![Page 220: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/220.jpg)
Cocoa APIs in SwiftWhen to consider using label on first argument
Cases where arguments are “equally weighted” subparts of a whole
Instead of func moveToX(CGFloat, y:CGFloat)
Perhaps func move(x:CGFloat, y:CGFloat), or moveToLocation(x:CGFloat, y:CGFloat)
Better yet do func moveToLocation(NSPoint)
![Page 221: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/221.jpg)
Cocoa APIs in SwiftWhen to consider using label on first argument
Cases where arguments are “equally weighted” subparts of a whole
Instead of func moveToX(CGFloat, y:CGFloat)
Perhaps func move(x:CGFloat, y:CGFloat), or moveToLocation(x:CGFloat, y:CGFloat)
Better yet do func moveToLocation(NSPoint)
Use a “combined” type where appropriate • NSDate/NSDateComponents, NS/UIColor, NSRange, CGRect, SCNVector3, …
![Page 222: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/222.jpg)
Cocoa APIs in SwiftInit methods
![Page 223: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/223.jpg)
Cocoa APIs in SwiftInit methods
Declaration- (instancetype)initWithFrame:(NSRect)frameRect;
![Page 224: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/224.jpg)
Cocoa APIs in SwiftInit methods
Declaration- (instancetype)initWithFrame:(NSRect)frameRect;
init(frame frameRect:NSRect)
![Page 225: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/225.jpg)
Cocoa APIs in SwiftInit methods
Declaration- (instancetype)initWithFrame:(NSRect)frameRect;
init(frame frameRect:NSRect)
![Page 226: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/226.jpg)
Cocoa APIs in SwiftInit methods
Declaration- (instancetype)initWithFrame:(NSRect)frameRect;
init(frame frameRect:NSRect)
Invocationview = NSView(frame:rect)
![Page 227: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/227.jpg)
Cocoa APIs in SwiftInit methods
Declaration- (instancetype)initWithFrame:(NSRect)frameRect;
init(frame frameRect:NSRect)
Invocationview = NSView(frame:rect)
![Page 228: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/228.jpg)
Cocoa APIs in SwiftConvenience constructors
![Page 229: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/229.jpg)
Cocoa APIs in SwiftConvenience constructors
Declaration+ (NSColor *)colorWithPatternImage:(NSImage *)image;
![Page 230: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/230.jpg)
Cocoa APIs in SwiftConvenience constructors
Declaration+ (NSColor *)colorWithPatternImage:(NSImage *)image;
init(patternImage image:NSImage?)
![Page 231: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/231.jpg)
Cocoa APIs in SwiftConvenience constructors
Declaration+ (NSColor *)colorWithPatternImage:(NSImage *)image;
init(patternImage image:NSImage?)
Invocationcolor = NSColor(patternImage:image)
![Page 232: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/232.jpg)
Cocoa APIs in SwiftEnumerated types
![Page 233: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/233.jpg)
Cocoa APIs in SwiftEnumerated types
typedef NS_ENUM(NSInteger, NSByteCountFormatterCountStyle) { NSByteCountFormatterCountStyleFile, NSByteCountFormatterCountStyleMemory, NSByteCountFormatterCountStyleDecimal, NSByteCountFormatterCountStyleBinary };
![Page 234: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/234.jpg)
Cocoa APIs in SwiftEnumerated types
typedef NS_ENUM(NSInteger, NSByteCountFormatterCountStyle) { NSByteCountFormatterCountStyleFile, NSByteCountFormatterCountStyleMemory, NSByteCountFormatterCountStyleDecimal, NSByteCountFormatterCountStyleBinary };
enum NSByteCountFormatterCountStyle : Int { case File case Memory case Decimal case Binary}
![Page 235: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/235.jpg)
Cocoa APIs in SwiftEnumerated types
enum NSByteCountFormatterCountStyle : Int { case File case Memory case Decimal case Binary}
![Page 236: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/236.jpg)
Cocoa APIs in SwiftEnumerated types
enum NSByteCountFormatterCountStyle : Int { case File case Memory case Decimal case Binary}
NSByteCountFormatter.stringFromByteCount(numBytes, countStyle:NSByteCountFormatterCountStyle.File)
![Page 237: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/237.jpg)
Cocoa APIs in SwiftEnumerated types
enum NSByteCountFormatterCountStyle : Int { case File case Memory case Decimal case Binary}
NSByteCountFormatter.stringFromByteCount(numBytes, countStyle:NSByteCountFormatterCountStyle.File)
NSByteCountFormatter.stringFromByteCount(numBytes, countStyle:.File)
![Page 238: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/238.jpg)
Related Sessions
• Introduction to Swift Presidio Tuesday 2:00PM
• Integrating Swift with Objective-C Presidio Wednesday 9:00AM
• Swift Interoperability In Depth Presidio Wednesday 3:15PM
• Creating Modern Cocoa Apps Marina Thursday 10:15AM
![Page 239: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/239.jpg)
Labs
• Swift Lab Tools Lab A Every day 9:00AM
![Page 240: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/240.jpg)
FPO Image - Option 1: Please confirm before purchase
![Page 241: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/241.jpg)
Gesture Recognizers
![Page 242: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/242.jpg)
Gesture Recognizers
![Page 243: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/243.jpg)
Gesture Recognizers
New class NSGestureRecognizer
![Page 244: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/244.jpg)
Gesture Recognizers
New class NSGestureRecognizer
Subclasses • NSClickGestureRecognizer
• NSMagnificationGestureRecognizer
• NSPanGestureRecognizer
• NSPressGestureRecognizer
• NSRotationGestureRecognizer
![Page 245: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/245.jpg)
Gesture Recognizers
New class NSGestureRecognizer
Subclasses • NSClickGestureRecognizer
• NSMagnificationGestureRecognizer
• NSPanGestureRecognizer
• NSPressGestureRecognizer
• NSRotationGestureRecognizer
APIs to create custom subclasses
![Page 246: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/246.jpg)
Related Sessions
• Storyboards and Controllers on OS X Pacific Heights Tuesday 4:30PM
![Page 247: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/247.jpg)
Block-based Event Tracking
![Page 248: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/248.jpg)
Block-based Event Tracking
@interface NSWindow … !
- (void)trackEventsMatchingMask:(NSEventMask)mask timeout:(NSTimeInterval)timeout mode:(NSString *)mode handler:(void(^)(NSEvent *event, BOOL *stop))tracker;
![Page 249: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/249.jpg)
Block-based Event Tracking
@interface NSWindow … !
- (void)trackEventsMatchingMask:(NSEventMask)mask timeout:(NSTimeInterval)timeout mode:(NSString *)mode handler:(void(^)(NSEvent *event, BOOL *stop))tracker;
Continuously track events until stopped or timeout is reached
![Page 250: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/250.jpg)
Accessibility
![Page 251: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/251.jpg)
New Accessibility APIsSimpler
![Page 252: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/252.jpg)
New Accessibility APIsSimpler
Accessibility values expressed directly as properties
![Page 253: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/253.jpg)
New Accessibility APIsSimpler
Accessibility values expressed directly as properties
No need to subclass
![Page 254: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/254.jpg)
New Accessibility APIsSimpler
Accessibility values expressed directly as properties
No need to subclass
Better compile time warnings
![Page 255: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/255.jpg)
New Accessibility APIs
Before - (id)accessibilityAttributeValue:(NSString *)attr { if ([attr isEqualToString:NSAccessibilityDescriptionAttribute]) { return NSLocalizedString(@"Take Screenshot", @“…”); } else { return [super accessibilityAttributeValue:attr]; } }
Now - (NSString *)accessibilityLabel { return NSLocalizedString(@"Take Screenshot", @“…”); }
![Page 256: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/256.jpg)
Related Sessions
• Accessibility on OS X Russian Hill Tuesday 2:00PM
![Page 257: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/257.jpg)
Labs
• Accessibility and Speech Lab Frameworks Lab B Wednesday 10:15AM
![Page 258: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/258.jpg)
Power
![Page 259: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/259.jpg)
Quality of Service
New property on NSOperation, NSOperationQueue, NSThread, … @property NSQualityOfService qualityOfService; !
Allows indicating the nature and importance of work
Lets the system manage resources
![Page 260: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/260.jpg)
Quality of Service
typedef NS_ENUM(NSInteger, NSQualityOfService) { NSQualityOfServiceUserInteractive, NSQualityOfServiceUserInitiated, NSQualityOfServiceUtility, NSQualityOfServiceBackground, NSQualityOfServiceDefault };
![Page 261: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/261.jpg)
Quality of Service
typedef NS_ENUM(NSInteger, NSQualityOfService) { NSQualityOfServiceUserInteractive, NSQualityOfServiceUserInitiated, NSQualityOfServiceUtility, NSQualityOfServiceBackground, NSQualityOfServiceDefault };
// Scrolling email message
![Page 262: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/262.jpg)
Quality of Service
typedef NS_ENUM(NSInteger, NSQualityOfService) { NSQualityOfServiceUserInteractive, NSQualityOfServiceUserInitiated, NSQualityOfServiceUtility, NSQualityOfServiceBackground, NSQualityOfServiceDefault };
// Scrolling email message// Showing an email message
![Page 263: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/263.jpg)
Quality of Service
typedef NS_ENUM(NSInteger, NSQualityOfService) { NSQualityOfServiceUserInteractive, NSQualityOfServiceUserInitiated, NSQualityOfServiceUtility, NSQualityOfServiceBackground, NSQualityOfServiceDefault };
// Scrolling email message// Showing an email message// Periodic mail fetch
![Page 264: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/264.jpg)
Quality of Service
typedef NS_ENUM(NSInteger, NSQualityOfService) { NSQualityOfServiceUserInteractive, NSQualityOfServiceUserInitiated, NSQualityOfServiceUtility, NSQualityOfServiceBackground, NSQualityOfServiceDefault };
// Scrolling email message// Showing an email message// Periodic mail fetch// Indexing
![Page 265: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/265.jpg)
Quality of Service
typedef NS_ENUM(NSInteger, NSQualityOfService) { NSQualityOfServiceUserInteractive, NSQualityOfServiceUserInitiated, NSQualityOfServiceUtility, NSQualityOfServiceBackground, NSQualityOfServiceDefault };
// Scrolling email message// Showing an email message// Periodic mail fetch// Indexing// Inferred from environment
![Page 266: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/266.jpg)
NSBackgroundActivityScheduler
Cocoa-level interface to the XPC Activity API
Schedule maintenance or background kinds of tasks
![Page 267: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/267.jpg)
Related Sessions
• Writing Energy Efficient Code, Part 1 Russian Hill Wednesday 10:15AM
• Power, Performance and Diagnostics: What's new in GCD and XPC
Russian Hill Thursday 2:00PM
![Page 268: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/268.jpg)
NSString
![Page 269: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/269.jpg)
NSString Encoding Detector
![Page 270: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/270.jpg)
NSString Encoding Detector
API to detect string encoding of a sequence of bytes !
+ (NSStringEncoding)stringEncodingForData:(NSData *)data encodingOptions:(NSDictionary *)opts convertedString:(NSString **)string usedLossyConversion:(BOOL *)usedLossyConversion;
![Page 271: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/271.jpg)
NSString Encoding Detector
API to detect string encoding of a sequence of bytes !
+ (NSStringEncoding)stringEncodingForData:(NSData *)data encodingOptions:(NSDictionary *)opts convertedString:(NSString **)string usedLossyConversion:(BOOL *)usedLossyConversion;
Options include
![Page 272: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/272.jpg)
NSString Encoding Detector
API to detect string encoding of a sequence of bytes !
+ (NSStringEncoding)stringEncodingForData:(NSData *)data encodingOptions:(NSDictionary *)opts convertedString:(NSString **)string usedLossyConversion:(BOOL *)usedLossyConversion;
Options include• Encodings to be considered or not
![Page 273: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/273.jpg)
NSString Encoding Detector
API to detect string encoding of a sequence of bytes !
+ (NSStringEncoding)stringEncodingForData:(NSData *)data encodingOptions:(NSDictionary *)opts convertedString:(NSString **)string usedLossyConversion:(BOOL *)usedLossyConversion;
Options include• Encodings to be considered or not
• Whether to allow lossy conversion
![Page 274: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/274.jpg)
NSString Encoding Detector
API to detect string encoding of a sequence of bytes !
+ (NSStringEncoding)stringEncodingForData:(NSData *)data encodingOptions:(NSDictionary *)opts convertedString:(NSString **)string usedLossyConversion:(BOOL *)usedLossyConversion;
Options include• Encodings to be considered or not
• Whether to allow lossy conversion
• Language hint
![Page 275: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/275.jpg)
NSString
Two other small new APIs - (BOOL)containsString:(NSString *)str; - (BOOL)localizedCaseInsensitiveContainsString:(NSString *)str;
![Page 276: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/276.jpg)
Tagged Pointer Strings
![Page 277: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/277.jpg)
Tagged Pointer Strings
Where possible, we stuff the whole NSString into the object pointer itself
![Page 278: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/278.jpg)
NSString *nameString = [NSString stringWithUTF8String:“WWDC 2014”];
![Page 279: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/279.jpg)
nameString
NSString *nameString = [NSString stringWithUTF8String:“WWDC 2014”];
![Page 280: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/280.jpg)
nameString
Class pointer (isa)
Length, ref count, etc
“ W W D C 2 0 1 4 “
…
NSString *nameString = [NSString stringWithUTF8String:“WWDC 2014”];
![Page 281: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/281.jpg)
Class pointer (isa)
Length, ref count, etc
“ W W D C 2 0 1 4 “
…
nameString
NSString *nameString = [NSString stringWithUTF8String:“WWDC 2014”];
![Page 282: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/282.jpg)
Class pointer (isa) Length, ref count, etc“ W W D C 2 0 1 4 “…nameString “ W W D C 2 0 1 4 “ …
NSString *nameString = [NSString stringWithUTF8String:“WWDC 2014”];
![Page 283: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/283.jpg)
Class pointer (isa) Length, ref count, etc“ W W D C 2 0 1 4 “…nameString “ W W D C 2 0 1 4 “ …
NSString *nameString = [NSString stringWithUTF8String:“WWDC 2014”];
![Page 284: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/284.jpg)
Tagged Pointer StringsThings to watch for
![Page 285: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/285.jpg)
Tagged Pointer StringsThings to watch for
No isa pointer!
![Page 286: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/286.jpg)
Tagged Pointer StringsThings to watch for
No isa pointer!
Different performance characteristics
![Page 287: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/287.jpg)
Tagged Pointer StringsThings to watch for
No isa pointer!
Different performance characteristics
Better out-of-bounds checking
![Page 288: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/288.jpg)
Tagged Pointer StringsThings to watch for
No isa pointer!
Different performance characteristics
Better out-of-bounds checking
Automatically enabled in 64-bit apps linked against 10.10 SDK
![Page 289: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/289.jpg)
Formatters
![Page 290: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/290.jpg)
New NSFormatters
![Page 291: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/291.jpg)
New NSFormatters
NSMassFormatter • 25.8 pounds
![Page 292: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/292.jpg)
New NSFormatters
NSMassFormatter
NSEnergyFormatter • 800 kcal
![Page 293: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/293.jpg)
New NSFormatters
NSMassFormatter
NSEnergyFormatter
NSLengthFormatter • 42.5 miles
![Page 294: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/294.jpg)
New NSFormatters
NSMassFormatter
NSEnergyFormatter
NSLengthFormatter
NSDateIntervalFormatter • Jun 3, 2014, 11:30 AM-12:30 PM
![Page 295: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/295.jpg)
New NSFormatters
NSMassFormatter
NSEnergyFormatter
NSLengthFormatter
NSDateIntervalFormatter• Jun 3, 2014, 11:30 AM-12:30 PM
NSDateComponentsFormatter• 3 hours, 25 minutes, 42 seconds
![Page 296: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/296.jpg)
New NSFormatters
NSMassFormatter
NSEnergyFormatter
NSLengthFormatter
NSDateIntervalFormatter• Jun 3, 2014, 11:30 AM-12:30 PM
NSDateComponentsFormatter• 3 hours, 25 minutes, 42 seconds
• About 10 minutes remaining
![Page 297: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/297.jpg)
New NSFormatters
NSMassFormatter
NSEnergyFormatter
NSLengthFormatter
NSDateIntervalFormatter
NSDateComponentsFormatter
Various customization options
![Page 298: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/298.jpg)
New NSFormatters
NSMassFormatter
NSEnergyFormatter
NSLengthFormatter
NSDateIntervalFormatter
NSDateComponentsFormatter
Various customization options
Formatting only, no parsing
![Page 299: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/299.jpg)
Formatting Context
![Page 300: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/300.jpg)
Formatting Context
typedef NS_ENUM(NSInteger, NSFormattingContext) { NSFormattingContextUnknown, NSFormattingContextDynamic, NSFormattingContextStandalone, NSFormattingContextListItem, NSFormattingContextBeginningOfSentence, NSFormattingContextMiddleOfSentence };
![Page 301: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/301.jpg)
Formatting Context
enum NSFormattingContext : Int { Unknown, Dynamic, Standalone, ListItem, BeginningOfSentence, MiddleOfSentence }
![Page 302: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/302.jpg)
Formatting Context
enum NSFormattingContext : Int { Unknown, Dynamic, Standalone, ListItem, BeginningOfSentence, MiddleOfSentence }
// “Juin 2014 …”
![Page 303: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/303.jpg)
Formatting Context
enum NSFormattingContext : Int { Unknown, Dynamic, Standalone, ListItem, BeginningOfSentence, MiddleOfSentence }
// “Juin 2014 …”// “… juin 2014 …”
![Page 304: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/304.jpg)
Formatting Context
enum NSFormattingContext : Int { Unknown, Dynamic, Standalone, ListItem, BeginningOfSentence, MiddleOfSentence }
// “Juin 2014 …”// “… juin 2014 …”
// Chooses automatically
![Page 305: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/305.jpg)
Related Sessions
• Advanced Topics in Internationalization Russian Hill Tuesday 9:00AM
![Page 306: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/306.jpg)
Labs
• Internationalization Lab Frameworks Lab B Tuesday 3:15PM
• Foundation Lab Frameworks Lab B Wednesday 9:00AM
![Page 307: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/307.jpg)
iCloud
![Page 308: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/308.jpg)
CloudKit
New framework for managing structured data on iCloud and sharing between users
Back-end for iCloud document storage
!
![Page 309: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/309.jpg)
Related Sessions
• Introducing CloudKit Mission Tuesday 3:15PM
• Advanced CloudKit Mission Thursday 3:15PM
![Page 310: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/310.jpg)
iCloud Document Storage
![Page 311: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/311.jpg)
iCloud Document Storage
New back-end
![Page 312: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/312.jpg)
iCloud Document Storage
New back-end
Document versions available on iCloud
![Page 313: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/313.jpg)
iCloud Document Storage
New back-end
Document versions available on iCloud
iCloud Drive available to all applications
![Page 314: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/314.jpg)
iCloud Document Storage
Handling of non-downloaded files has changed • Now tracked with invisible files with different names
![Page 315: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/315.jpg)
iCloud Document Storage
Handling of non-downloaded files has changed • Now tracked with invisible files with different names
Use NSMetadataQuery, NSMetadataItem, and NSFileCoordinator to access iCloud files
![Page 316: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/316.jpg)
iCloud Document Storage
Handling of non-downloaded files has changed • Now tracked with invisible files with different names
Use NSMetadataQuery, NSMetadataItem, and NSFileCoordinator to access iCloud files
Do not enumerate iCloud container contents directly • If you do, ignore hidden or unrecognized files
![Page 317: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/317.jpg)
iCloud Document Storage
Handling of non-downloaded files has changed • Now tracked with invisible files with different names
Use NSMetadataQuery, NSMetadataItem, and NSFileCoordinator to access iCloud files
Do not enumerate iCloud container contents directly • If you do, ignore hidden or unrecognized files
To get metadata, use the new “promised item” APIs on NSURL - (BOOL)getPromisedItemResourceValue:(id *)value forKey:(NSString *)key error:(NSError **)error;
![Page 318: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/318.jpg)
Related Sessions
• Building a Document-based App Marina Thursday 11:30AM
![Page 319: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/319.jpg)
Core Data
![Page 320: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/320.jpg)
Core Data
![Page 321: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/321.jpg)
Core Data
Batch updates with NSBatchUpdateRequest
![Page 322: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/322.jpg)
Core Data
Batch updates with NSBatchUpdateRequest
Asynchronous fetching with NSAsynchronousFetchRequest • Also provides NSProgress support
![Page 323: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/323.jpg)
Core Data
Batch updates with NSBatchUpdateRequest
Asynchronous fetching with NSAsynchronousFetchRequest • Also provides NSProgress support
iCloud • Infrastructure improvements
![Page 324: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/324.jpg)
Related Sessions
• What’s New in Core Data Pacific Heights Thursday 9:00AM
![Page 325: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/325.jpg)
Labs
• Core Data Lab Services Lab B Wednesday 9:00AM
• Core Data Lab Services Lab B Thursday 10:15AM
• Core Data Lab Services Lab B Friday 9:00AM
![Page 326: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/326.jpg)
FPO Image - Option 2: Please confirm before purchase
I prefer this one, thanks
![Page 327: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/327.jpg)
Auto Layout
![Page 328: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/328.jpg)
Auto Layout
New APIs to activate NSLayoutConstraints directly + (void)activateConstraints:(NSArray *)constraints; + (void)deactivateConstraints:(NSArray *)constraints; @property (getter=isActive) BOOL active;
![Page 329: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/329.jpg)
Auto Layout
New APIs to activate NSLayoutConstraints directly + (void)activateConstraints:(NSArray *)constraints; + (void)deactivateConstraints:(NSArray *)constraints; @property (getter=isActive) BOOL active;
These replace the existing APIs on NSView - (void)addConstraint:(NSLayoutConstraint *)constraint; - (void)addConstraints:(NSArray *)constraints; - (void)removeConstraint:(NSLayoutConstraint *)constraint; - (void)removeConstraints:(NSArray *)constraints;
![Page 330: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/330.jpg)
NSCellOn its way to formal deprecation
![Page 331: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/331.jpg)
NSCellOn its way to formal deprecation
Some NSCell APIs promoted to their corresponding NSControl subclasses • NSControl, NSTextField, NSSearchField, NSLevelIndicator, NSSlider, NSPathControl
• Use the controls where possible
![Page 332: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/332.jpg)
NSCellOn its way to formal deprecation
Some NSCell APIs promoted to their corresponding NSControl subclasses • NSControl, NSTextField, NSSearchField, NSLevelIndicator, NSSlider, NSPathControl
• Use the controls where possible
NSCell-based NSTableView deprecated • Use view-based NSTableView
![Page 333: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/333.jpg)
NSCellOn its way to formal deprecation
Some NSCell APIs promoted to their corresponding NSControl subclasses • NSControl, NSTextField, NSSearchField, NSLevelIndicator, NSSlider, NSPathControl
• Use the controls where possible
NSCell-based NSTableView deprecated • Use view-based NSTableView
NSMatrix-based NSBrowser deprecated • Use item-based NSBrowser
![Page 334: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/334.jpg)
NSCellOn its way to formal deprecation
Some NSCell APIs promoted to their corresponding NSControl subclasses • NSControl, NSTextField, NSSearchField, NSLevelIndicator, NSSlider, NSPathControl
• Use the controls where possible
NSCell-based NSTableView deprecated • Use view-based NSTableView
NSMatrix-based NSBrowser deprecated • Use item-based NSBrowser
NSMatrix on its way out too • Sibling radio buttons with same action will now operate as a group
![Page 335: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/335.jpg)
More New Stuff
![Page 336: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/336.jpg)
More New Stuff
NSTableView • Create statically
![Page 337: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/337.jpg)
More New Stuff
NSTableView • Create statically
NSImage • Specify fancy resizing behaviors with capInsets and resizingMode
![Page 338: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/338.jpg)
More New Stuff
NSTableView • Create statically
NSImage • Specify fancy resizing behaviors with capInsets and resizingMode
NSBitmapImageRep • More bitmap formats, for instance BGRA
![Page 339: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/339.jpg)
More New Stuff
NSTableView • Create statically
NSImage • Specify fancy resizing behaviors with capInsets and resizingMode
NSBitmapImageRep • More bitmap formats, for instance BGRA
Asset catalogs • Support for more formats and slicing
![Page 340: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/340.jpg)
Some More New Stuff
NSAttributedString • Apply letterpress text effect
![Page 341: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/341.jpg)
Some More New Stuff
NSAttributedString • Apply letterpress text effect
NSPopover • Delegate method popoverShouldDetach:
![Page 342: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/342.jpg)
Some More New Stuff
NSAttributedString • Apply letterpress text effect
NSPopover • Delegate method popoverShouldDetach:
NSComboBox, NSDatePicker, NSPopupButton, NSSearchField, and NSSplitView • Flip as expected for right-to-left
![Page 343: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/343.jpg)
Some More New Stuff
NSAttributedString • Apply letterpress text effect
NSPopover • Delegate method popoverShouldDetach:
NSComboBox, NSDatePicker, NSPopupButton, NSSearchField, and NSSplitView • Flip as expected for right-to-left
NSNibLoading • Do custom setup in your view subclass for live views support in Interface Builder
![Page 344: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/344.jpg)
Other New Stuff
NSOpenGLContext • Query the pixelFormat and lock the context without going down to CGLContext
![Page 345: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/345.jpg)
Other New Stuff
NSOpenGLContext • Query the pixelFormat and lock the context without going down to CGLContext
NSFileCoordinator • Asynchronous waiting with coordinateAccessWithIntents:queue:byAccessor:
![Page 346: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/346.jpg)
Other New Stuff
NSOpenGLContext • Query the pixelFormat and lock the context without going down to CGLContext
NSFileCoordinator • Asynchronous waiting with coordinateAccessWithIntents:queue:byAccessor:
NSWorkspace • Specify which apps to use and how when opening URLs
![Page 347: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/347.jpg)
Other New Stuff
NSOpenGLContext • Query the pixelFormat and lock the context without going down to CGLContext
NSFileCoordinator • Asynchronous waiting with coordinateAccessWithIntents:queue:byAccessor:
NSWorkspace • Specify which apps to use and how when opening URLs
NSURL • Resolve alias files with URLByResolvingAliasFileAtURL:options:error:
![Page 348: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/348.jpg)
And Even More New Stuff
NSProcessInfo • operatingSystemVersion, and isOperatingSystemAtLeastVersion:
![Page 349: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/349.jpg)
And Even More New Stuff
NSProcessInfo • operatingSystemVersion, and isOperatingSystemAtLeastVersion:
NSXPCConnection • NSProgress support across processes
![Page 350: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/350.jpg)
Summary
![Page 351: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/351.jpg)
Summary
New Look
Extensions
Handoff
Storyboards and View Controllers
API Modernization
Swift
And many others…
![Page 352: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/352.jpg)
More Information
Jake Behrens Frameworks Evangelist [email protected]
Documentation Mac Dev Center https://developer.apple.com/devcenter/mac
Release Notes Application Kit Release Notes, Foundation Kit Release Notes http://developer.apple.com/mac
Apple Developer Forums http://devforums.apple.com
![Page 353: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/353.jpg)
Related Sessions
• Creating Modern Cocoa Apps Marina Thursday 10:15AM
• Adapting Your App to the New UI of OS X Yosemite
Pacific Heights Tuesday 3:15PM
• Adopting Advanced Features of the New UI of OS X Yosemite
Marina Wednesday 2:00PM
• Storyboards and Controllers on OS X Pacific Heights Tuesday 4:30PM
• Creating Extensions for iOS and OS X, Part 1 Mission Tuesday 2:00PM
• Adopting Handoff on iOS and OS X Marina Wednesday 2:00PM
• What's New in Interface Builder Mission Wednesday 3:15PM
![Page 354: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/354.jpg)
Labs
• Cocoa Lab Frameworks Lab B Tuesday 12:30PM
• Internationalization Lab Frameworks Lab B Tuesday 3:15PM
• Foundation Lab Frameworks Lab B Wednesday 9:00AM
• New UI and Cocoa Lab Frameworks Lab B Wednesday 3:15PM
• View Controllers and Cocoa Lab Frameworks Lab B Thursday 11:30AM
• Cocoa Lab Frameworks Lab B Thursday 4:30PM
![Page 355: What’s New in Cocoa...Storyboard New classes • NSStoryboard • NSStoryboardSegue New protocol • NSSeguePerforming New APIs on NSViewController, NSWindowController • NSSeguePerforming](https://reader031.vdocuments.net/reader031/viewer/2022013022/5f8274b48185ce5fff032b4c/html5/thumbnails/355.jpg)