Software Dev

Simple iOS Performance Tips

A former ๏ฃฟ engineer gives us “a checklist of performance tips that would hopefully give you the biggest bang for your buck.”

I have noticed that there was a pattern of low-hanging fruits, where you could make 80% of the performance gains in 20% of the time.

๐Ÿ‘‰ iOS Performance tips you probably didn’t know (from an ex-Apple engineer)

Cheat sheet:

  • UILabel costs more than than you think
  • Always start with serial queues, and only use concurrent queues as a last resort
  • Some system components will only free up memory when they receive a memory warning
  • Avoid using dispatch_semaphore_t to wait for asynchronous work
  • Donโ€™t use UIView tags
Racetrack

Via iOS Dev Weekly.

Software Dev

State Machines in SwiftUI

An app view that changes its state in complicated ways is difficult to do right. We developers have even been trying to avoid state when possible. But if you really just have to deal with a complex state-driven app view, then embrace it with a state machine.

๐Ÿ‘‰ Building a state-driven app in SwiftUI using state machines

Honestly, this is my favorite programming technique, where the really interesting stuff happens. ๐Ÿ‘

Via iOS Dev Weekly.