Skip to content

Instantly share code, notes, and snippets.

View danielt1263's full-sized avatar

Daniel Tartaglia danielt1263

View GitHub Profile
@danielt1263
danielt1263 / AddressBook.h
Last active August 29, 2015 14:09
Easily access a read-only array of all the people in the contacts database for iOS. (Because Apple STILL hasn't made an ABAddressBook class for iOS like they did for MacOS.
#import <Foundation/Foundation.h>
extern NSString *addressBookErrorDomain;
typedef NS_ENUM(NSInteger, AddressBookError) {
AddressBookErrorOK,
AddressBookErrorNoAddressBook,
AddressBookErrorNoAccess
};
@danielt1263
danielt1263 / Signal.swift
Last active May 15, 2020 14:23
Swift replacement for KVO
//
// Signal.swift
//
// Created by Daniel Tartaglia on 9/6/15.
// Copyright © 2016 Daniel Tartaglia. MIT License.
//
public protocol Disposable {
func dispose()
}
//
// ArrayCompare.swift
//
// Created by Daniel Tartaglia on Sep 10, 2015.
// Inspired by http://www.swift-studies.com/blog/2015/5/15/swift-coding-challenge-incremental-updates-to-views
//
public func findDifferences<T : Hashable>(old: [T], new:[T], moveBlock: (_ from: Int, _ to: Int)->()) -> (insertions: [Int], removals: [Int])
{
var insertionIndexs = [Int]()
//
// KeyboardScrollController.swift
//
// Created by Daniel Tartaglia on 9/16/15.
// Copyright © 2015. MIT License.
//
import UIKit
//
// PromiseKitAdditions.swift
//
// Created by Daniel Tartaglia on 11/4/15.
// Copyright © 2018. MIT License.
//
import PromiseKit
@danielt1263
danielt1263 / Redux.swift
Last active November 27, 2017 15:06
My Redux like implementation.
//
// Redux.swift
//
// Created by Daniel Tartaglia on 01/16/15.
// Copyright © 2017. MIT License.
//
public final class Store<State, Action> {
//
// UIViewAdditions.swift
//
// Created by Daniel Tartaglia on 04/15/15.
// Copyright © 2016. MIT License.
//
import UIKit
//
// UIViewController+GetImage.swift
//
// Created by Daniel Tartaglia on 4/25/16.
// Copyright © 2016 MIT License
//
import UIKit
import PromiseKit
//
// CLGeocoder+Rx.swift
//
// Created by Daniel Tartaglia on 5/7/16.
// Copyright © 2018 Daniel Tartaglia. MIT License.
//
import RxSwift
import CoreLocation
import Contacts
@danielt1263
danielt1263 / Regex.swift
Last active May 1, 2017 23:53
Make regexs simpler in Swift.
//
// Regex.swift
//
// Created by Daniel Tartaglia on 2/6/16.
// Copyright © 2016 Daniel Tartaglia. MIT License.
//
import Foundation