What’s New in Cocoa for macOS

WWDC 2018

Posted by Den on September 27, 2018 · 13 mins read
What’s New in Cocoa for macOS

What’s New in Cocoa for macOS

WWDC 2018

What’s New in Cocoa for macOS

WWDC 2018

String Type Updates

String Enumeration to String Type

Common Prefixes

Formalized Protocols

Direct Instance Variable Access

Formal Soft Deprecation

Secure Coding ( new )

  • New APIs in NSKeyedArchiver and NSKeyedUnarchiver
  • Enable
    - Secure coding
    - Error returns

Secure Coding Value Transformer

Secure Coding Adoption

Dark Mode

Supporting Dark Mode

  • Link against macOS 10.14
  • Use appearance-sensitive colors
  • Use template images

Appearance-Sensitive NSColors

Defining Custom Colors in Asset Catalogs

Defining Template Images in Asset Catalogs

Defining Custom Images in Asset Catalogs

Desktop Pictures

Desktop Picture Aware Classes

  • NSWindow
  • NSScrollView
  • NSTableView
  • NSCollectionView

Classes and Color That Look and Taste Great Together

NSVisualEffectView

Accent Colors

NSColor Effects

Content Tint Color

  • NSButton
  • NSImageView

Layer Backing

  • Apps linked against 10.14 will no longer use window backing stores
  • Views are rendered exclusively with CALayers
  • No longer necessary to set .wantsLayer = true
  • AppKit handles this for you 👍
  • Composition works for all cases
  • Build complicated controls out of NSImageView, NSBox, NSTextField

UIViews to CALayers

NSViews to CALayers

Obsolete Patterns

Layer Backing and OpenGL ⚠️

Font antialiasing refinements

User Notifications Framework on macOS

  • NSApplication
  • UNUserNotificationCenter
  • Deprecated in NSApplication
  • Deprecated all of NSUserNotification

NSToolbar

NSGridView

NSTextView

  • New factory methods
  • Style-matching text replacement
    - Performs appropriate delegate calls
    - Unspecified attributes “filled in” by typingAttributes

Continuity Camera

  • Services API on NSResponder

Custom Quick Actions

  • Perform simple or complex actions
  • Filter file lists or operate on file data
  • Manipulate document content in place
  • Accessible in many places

Building Action Bundles