Skip to content

Instantly share code, notes, and snippets.

@donnywals
Created June 6, 2018 21:16
Show Gist options
  • Save donnywals/a65291b03c10b90b9364a61222dec930 to your computer and use it in GitHub Desktop.
Save donnywals/a65291b03c10b90b9364a61222dec930 to your computer and use it in GitHub Desktop.

What’s new in Cocoa Touch

Table view

  • Look at expensiveness of tableView(_:cellForRowAt:), often quite expensive.
  • layoutSubviews for cells can be quite expensive too.
  • Prefetching can be a big win, but not always
  • Two cells could be fighting for the CPU with prefetching. iOS 12 is smarter about this.
  • Better CPU ramping up

Automatic Backing Store

Used to improve memory because allocating memory that is not available yet is slow. It automatically optimizes storage in memory for images. You get this by default. More in Images and Graphics best practices

Notifications

  • Support interactions now
  • Grouped notifications, for instance by conversation
  • Settings linking in notfications

Messages

  • Stickers in camera
  • presentation contexts to see if you’re in camera or not
  • Swipes are now owned by your app instead of switching between apps

Siri suggestions

  • Activated using custom voice phrase
  • Pro-actively suggested by Siri
  • NSUserActivity and SiriIntents (more complex scenarios)
  • eligibleForPrediction = true on NSUserActivity and you’re good to go
  • SiriKit intents are part of a category, a lot of options are available there
  • User enters the phrase themselves
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment