Skip to content

Instantly share code, notes, and snippets.

View tcunning's full-sized avatar

Tod Cunningham tcunning

View GitHub Profile
@atljeremy
atljeremy / DateUtils.swift
Last active March 26, 2017 18:47
Swift extension on NSTimeInterval and NSDate to make NSDate Comparable and to make working with dates in general more concise
/*
Examples:
var date: NSDate
date = 10.seconds.fromNow
date = 30.minutes.ago
date = 2.days.from(someDate)
date = NSDate() + 3.days
if dateOne < dateTwo {