Skip to content

Instantly share code, notes, and snippets.


Andy Novak andynovak12

View GitHub Profile
View SCNVector3+MathUtils.swift
// SCNVector3+MathUtils.swift
// Created by Jeremy Conkin on 4/26/16.
import SceneKit
Add two vectors
steipete / PSPDFUIKitMainThreadGuard.m
Last active May 18, 2022
This is a guard that tracks down UIKit access on threads other than main. This snippet is taken from the commercial iOS PDF framework, 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…
View PSPDFUIKitMainThreadGuard.m
// Taken from the commercial iOS PDF framework
// Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved.
// Licensed under MIT (
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it.
// PLEASE DUPE rdar://27192338 ( if you would like to see this in UIKit.
#import <objc/runtime.h>
#import <objc/message.h>