NBUIKitMainThreadGuard

Swift UIView extension to check UIView methods are being called on the correct thread

71
9
Swift

NBUIKitMainThreadGuard

Checks UIView methods are being called on the correct thread. Swift re-work of PSPDFUIKitMainThreadGuard.m.

Installation

  1. Drag into project
  2. Select your project in the navigator, then the build settings tab
  3. Filter with ‘preprocessor macro’, then expand the row with the arrow on the left
  4. Double click in the debug row value, type DEBUG=1
  5. Filter with ‘other swift flags’, expland, in the debug row type -DDEBUG
  6. Add the following to the top of your App Delegate:
override init() {
    super.init()
    UIView.classInit
}

License

MIT