Vincent Tourraine
Blog

Notes WWDC 2021 : What’s new in UIKit

#dev #iOS

Mes notes pour la session What’s new in UIKit de la WWDC 2021.

Productivity

iPad multitasking: “center scene” (long tap + “Open in New Window” to open as modal), can then be moved to different multitasking mode:

let action = UIWindowScene.ActivationAction({ _ in
  let userActivity = NSUserActivity(activityType: "...")
  return UIWindowScene.ActivationConfiguration(userActivity: userActivity)
)}

// add action to menu

Pointer band selection enabled by default on UICollectionView that support multi-selection.

New keyboard shortcuts menu:

class AppDelegate: UIResponder, UIApplicationDelegate {
  override fun buildMenu(with builder: UIMenuBuilder) {
    // ...
  }
}

Focus-based keyboard navigation (from tvOS) now on iPadOS: arrows to switch between focus items, tab to switch between focus groups.

Inter-apps drag-and-drop now available on iOS.

UI refinements

API enhancements

Performance

Cell prefetching improvements (optional).

async to configure with images:

if let image = UIImage(contentsOfFile: ...) {
  async {
    let preparedImage = await image.byPreparingForDisplay()
    imageView.image = preparedImage
  }
}

Security and privacy

Location Button: one-time access to location, flexible configuration API.

Pasteboard banner no longer shown when using system “Copy”/“Paste” menu items. New paste items (“Paste and Go”, “Paste and Search”, “Paste and Match Style”). New API for pasteboard data detectors.