Skip to content

Instantly share code, notes, and snippets.

Nate Armstrong armstrongnate

Block or report user

Report or block armstrongnate

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
natecook1000 / NSTimer+Closure.swift
Last active Aug 1, 2019
Scheduled NSTimer with a Swift closure
View NSTimer+Closure.swift
extension NSTimer {
Creates and schedules a one-time `NSTimer` instance.
- Parameters:
- delay: The delay before execution.
- handler: A closure to execute after `delay`.
- Returns: The newly-created `NSTimer` instance.
tjw / protocol-type-member.swift
Last active Aug 29, 2015
Can't access members of protocol types
View protocol-type-member.swift
public protocol MeasurementUnit {
// If we have one of this unit, how many millimeters is it?
class var asMillimeters: Double { get }
public class Inch : MeasurementUnit {
public class var asMillimeters: Double {
get {
return 25.4
prrane / ReadAddressBook.swift
Created Sep 4, 2014
Swift: Get contact emails from AddressBook
View ReadAddressBook.swift
// based on :
class func extractABAddressBookRef(abRef: Unmanaged<ABAddressBookRef>!) -> ABAddressBookRef? {
if let ab = abRef {
return Unmanaged<NSObject>.fromOpaque(ab.toOpaque()).takeUnretainedValue()
return nil
staltz /
Last active Jun 6, 2020
The introduction to Reactive Programming you've been missing
View ArrayHelpers.swift
extension Array {
func first() -> Element? {
if isEmpty {
return nil
return self[0]
func last() -> Element? {
You can’t perform that action at this time.