Skip to content

Instantly share code, notes, and snippets.

Joshua Sullivan JoshuaSullivan

Block or report user

Report or block JoshuaSullivan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
JoshuaSullivan / display-link-combine-playground.swift
Created Nov 10, 2019
This gist demonstrates how we can wrap CADisplayLink to get frame refresh events via a published stream rather than the traditional `target:selector:` methodology.
View display-link-combine-playground.swift
JoshuaSullivan /
Last active Dec 29, 2019
An enumeration of iOS 13 Core Image filters.

Core Image Filters

iOS 13 has 218 filters.

New Filters in iOS 13

  • CIDocumentEnhancer
  • CIGaborGradients
  • CIKeystoneCorrectionCombined
  • CIKeystoneCorrectionHorizontal
  • CIKeystoneCorrectionVertical
JoshuaSullivan /
Last active Feb 5, 2019
Core Image Filter Details

Core Image Filters

iOS 12.2 has 207 filters.

Accordion Fold Transition (CIAccordionFoldTransition)

First available: iOS 8

Transitions from one image to another of a differing dimensions by unfolding.

JoshuaSullivan / AnalyticsBackEndProtocol.swift
Created Dec 18, 2018
A guide to mocking objects with static methods...
View AnalyticsBackEndProtocol.swift
protocol AnalyticsBackEnd {
static func log(_ name: String)
extension Analytics: AnalyticsBackEnd {}
JoshuaSullivan / UIImage.Orientation+Correction.swift
Created Dec 3, 2018
An extension on `UIImage.Orientation` to convert it to the corresponding `CGImagePropertyOrientation` case.
View UIImage.Orientation+Correction.swift
extension UIImage.Orientation {
/// Get the equivalent `CGImagePropertyOrientation` enum case.
var cgOrientation: CGImagePropertyOrientation {
switch self {
case .up: return .up
case .down: return .down
case .left: return .left
case .right: return .right
case .upMirrored: return .upMirrored
case .downMirrored: return .downMirrored
JoshuaSullivan / natural-language-playground.swift
Last active Aug 2, 2018
This playground demonstrates several features of the NaturalLanguage framework that's new in iOS 12.
View natural-language-playground.swift
//: # Natural Language Framework
//: by Josh Sullivan
import Swift
import NaturalLanguage
//: Create a short string to test.
let str = "I am the very model of a modern major general! 😎"
//: And a longer one. Yay, multi-line String literals!
let longStr = """
JoshuaSullivan / swift4-kvo-playground.swift
Created May 11, 2018
Here is a playground demonstrating how to set up Swift 4 KVO.
View swift4-kvo-playground.swift
//: # Setting up Swift 4 KVO
import Foundation
//: This class has a pair of properties that can be observied by KVO.
//: - Note: This class *must* inheret from `NSObject` in order to posess the KVO functionality.
class ObservableClass: NSObject {
/// An observable string property. Note that it most be annotated with both "@objc" (expose the property to the
/// Objective-C runtime) and "dynamic" (enables KVO for the property).
@objc dynamic private(set) var stringProperty: String = "Starting string!"
JoshuaSullivan / mobius-ring.pde
Created Mar 22, 2018
Processing script for rendering a Möbius Strip.
View mobius-ring.pde
class MobiusRing {
float majorRadius, minorRadius;
int segments;
PVector[] vertices;
MobiusRing(float majorRadius, float minorRadius, int segments) {
this.majorRadius = majorRadius;
this.minorRadius = minorRadius;
this.segments = segments;
JoshuaSullivan / CollectionViewDelegateSplitter.swift
Created Dec 8, 2017
These two shims allow you to split the UIScrollViewDelegate calls from the collection and table view delegate calls.
View CollectionViewDelegateSplitter.swift
// CollectionViewDelegateSplitter.swift
// Created by Joshua Sullivan on 12/7/17.
import UIKit
class CollectionViewDelegateSplitter: NSObject, UICollectionViewDelegate {
/// The object which will receive collection-related delegate actions.
JoshuaSullivan / arkit-quickstart.markdown
Last active Oct 3, 2017
A quick guide for getting up and running with ARKit.
View arkit-quickstart.markdown

Getting Started with ARKit

First things first: Augmented Reality is an inherently 3D activity. The ease with which you pick it up will be directly proportional to your existing experience working in 3D. This is not to say someone without 3D experience can't do AR, but it will be harder for you until you become more familiar with common 3D principles. The skill set used for creating 3D games and AR experiences are essentially the same.

If your'e a complete 3D noob, I suggest checking out some of the tutorials on getting started with 3D game development.

Step 1: Choose your IDE

The first decision to make is whether you want to use Xcode or a 3D game framework such as Unity or Unreal to create your experience. For the purposes of this guide, I'll assume you will choose Xcode, simply because I have no personal experience with the other two options. If you're already experienced with one of them or are feeling adventurous, then I'm sure you can find AR learning resources online.


You can’t perform that action at this time.