Skip to content

Instantly share code, notes, and snippets.

import UIKit
// Swift rewrite challenge by Erica Sadun: http://ericasadun.com/2016/05/31/swift-rewrite-challenge/
// Starting point: https://gist.github.com/erica/157e20ea0c7e9f28a03a8b12448c8fd0
// My solution builds on a small framework I have written with some geometry extensions on CGVector, CGPoint, CGRect and CGSize
// I call it GeometryKit and include the relevant parts here. This makes geometric calculations so much easier to understand.
// ------------------------------------------------------------------------------------