MacKuba

Kuba Suder's blog on Mac & iOS development

What’s New in AppKit for macOS

Categories: AppKit, Mac, WWDC 19 0 comments Watch the video

New system colors: NSColor.systemTeal and systemIndigo

NSColor uses tagged pointers

NSColorSampler – a magnifier tool for picking a color from somewhere on the screen

Recording the screen will now ask the user for permission

NSColor(name: “…”) { appearance … }

NSScreen.localizedName now returns e.g. “Thunderbolt Display”

(10.11)

CAMetal.wantsExtendedDynamicRangeContent = enables dynamic range in this layer

NSScreen.maximumExtendedDynamicRangeColorComponentValue = tells you the maximum white value (e.g. 1.3)

NSScreen.maximumPotentialExtendedDynamicRangeColorComponentValue – tells you this even when it’s not on

NSScreen.maximumReferenceExtendedDynamicRangeColorComponentValue

CAMetalLayer.preferredDevice, MTKView.preferredDevice

NSTextView.usesAdaptiveColorMappingForDarkAppearance – automatically updates colors for light/dark appearance

NSTextCheckingController + NSTextCheckingClient – for spell checking, data detection, autocorrection

NSFontDescriptorSystemDesign

NSAttributedString text scaling macOS  ⭤  iOS

NSLayoutManager.usesDefaultHyphenation

NSToolbarItem.isBordered, title

NSToolbarItemGroup: segmented controls and pulldown/popup menus, collapsed representation

NSMenuToolbarItem

NSTouchBar.isAutomaticCustomizeTouchBarMenuItemEnabled

NSStepperTouchBarItem

NSSliderTouchBarItem.minimumSliderWidth, maximumSliderWidth

NSSwitch – a new NSControl like UISwitch on iOS (avoid using for small things and in large numbers, just one for some general mode switch, like Time Machine on/off)

NSCollectionView – compositional layout, diffable data source

using custom VC initializers for injecting dependencies:

@IBSegueAction func showFoo(_ coder: NSCoder) -> NSViewController { }

NSView.isHorizontalContentSizeConstraintActive, isVertical

Open and save panels are now always out-of-process, even for non-sandboxed apps

NSWorkspace: asynchronous methods for opening URLs and applications

NSWorkspace.OpenConfiguration

Using iPad with Sidecar as a tablet: tablet events come as mouse events with NSEvent.SubType.tabletPoint and pressure

NSEventType .changeMode  ⭢  on double-tap on the pencil

NSDirectionalRectEdge

NSDirectionalEdgeInsets

NSRectAlignment

NSRelativeDateFormatter

NSListFormatter – formats list of things, adding commas properly

Non-UI file provider action extension

Replacing kernel extensions with Network Extensions, DriverKit, Endpoint Security



Leave a comment

*

*
This will only be used to display your Gravatar image.

*

What property can you use on iOS to get a unique device ID that the user can reset in Settings?

*