Skip to content

Instantly share code, notes, and snippets.

View toddhopkinson's full-sized avatar

Todd Hopkinson toddhopkinson

View GitHub Profile
// UIImage+Downsample.swift
// Created by Todd Hopkinson
import UIKit
extension UIImage {
func downsample(reductionAmount: Float) -> UIImage? {
let image = UIKit.CIImage(image: self)
@toddhopkinson
toddhopkinson / CameraButton.swift
Last active August 25, 2016 22:41
Custom UIButton Drawing UIBezierPaths to CAShapeLayers and morph-animating them via CABasicAnimation
// CameraButton.swift
// Created by Todd Hopkinson Aug 2016
// UIButton approximating Apple's camera button appearance and appearance behavior
import UIKit
enum CameraButtonMode {
case VideoReady
case VideoRecording
case PhotoReady