Skip to content

Instantly share code, notes, and snippets.

@MattSHallatt
MattSHallatt / ReuseIdentifiable.swift
Last active January 11, 2019 13:32
Easy addition of informative reuse identifiers
import UIKit
protocol ReuseIdentifiable {
static var reuseIdentifier: String { get }
}
extension ReuseIdentifiable {
static var reuseIdentifier: String {
return String(describing: self) + "ReuseIdentifier"
}
@MattSHallatt
MattSHallatt / Formatter.swift
Created November 30, 2017 17:44
Formatter
//
// Formatter.swift
// Formatter
//
// Created by Matthew Hallatt on 30/11/2017.
// Copyright © 2017 Gospelware. All rights reserved.
//
import Foundation
@MattSHallatt
MattSHallatt / DateComponentsFormatter.playground
Created November 30, 2017 15:06
DateComponentsFormatter Playground
import UIKit
/*:
DateComponentsFormatter: A formatter that creates string representations of quantities of time.
*/
let dateComponentsFormatter = DateComponentsFormatter()
/*:
A DateComponentsFormatter can be configured with an array of NSCalendarUnits. These components are then used in the output.