Skip to content

Instantly share code, notes, and snippets.

@bengottlieb
bengottlieb / PSPDFUIKitMainThreadGuard.m
Created March 1, 2017 02:55 — forked from steipete/PSPDFUIKitMainThreadGuard.m
This is a guard that tracks down UIKit access on threads other than main. This snippet is taken from the commercial iOS PDF framework http://pspdfkit.com, but relicensed under MIT. Works because a lot of calls internally call setNeedsDisplay or setNeedsLayout. Won't catch everything, but it's very lightweight and usually does the job.You might n…
//
// MainThreadGuard.m
// Honor
//
// Created by Ben Gottlieb on 2/28/17.
// Copyright © 2017 Ben Gottlieb. All rights reserved.
//
#import <Foundation/Foundation.h>