Skip to content

Instantly share code, notes, and snippets.

Daniel Tartaglia danielt1263

View GitHub Profile
@danielt1263
danielt1263 / AddressBook.h
Last active Aug 29, 2015
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.
View AddressBook.h
#import <Foundation/Foundation.h>
extern NSString *addressBookErrorDomain;
typedef NS_ENUM(NSInteger, AddressBookError) {
AddressBookErrorOK,
AddressBookErrorNoAddressBook,
AddressBookErrorNoAccess
};
@danielt1263
danielt1263 / Signal.swift
Last active May 15, 2020
Swift replacement for KVO
View Signal.swift
//
// Signal.swift
//
// Created by Daniel Tartaglia on 9/6/15.
// Copyright © 2016 Daniel Tartaglia. MIT License.
//
public protocol Disposable {
func dispose()
}
View ArrayCompare.swift
//
// 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]()
View KeyboardScrollController.swift
//
// KeyboardScrollController.swift
//
// Created by Daniel Tartaglia on 9/16/15.
// Copyright © 2015. MIT License.
//
import UIKit
View PromiseKitAdditions.swift
//
// PromiseKitAdditions.swift
//
// Created by Daniel Tartaglia on 11/4/15.
// Copyright © 2018. MIT License.
//
import PromiseKit
@danielt1263
danielt1263 / Redux.swift
Last active Nov 27, 2017
My Redux like implementation.
View Redux.swift
//
// Redux.swift
//
// Created by Daniel Tartaglia on 01/16/15.
// Copyright © 2017. MIT License.
//
public final class Store<State, Action> {
View UIViewAdditions.swift
//
// UIViewAdditions.swift
//
// Created by Daniel Tartaglia on 04/15/15.
// Copyright © 2016. MIT License.
//
import UIKit
View UIViewController+GetImage.swift
//
// UIViewController+GetImage.swift
//
// Created by Daniel Tartaglia on 4/25/16.
// Copyright © 2016 MIT License
//
import UIKit
import PromiseKit
View CLGeocoder+Rx.swift
//
// 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
Make regexs simpler in Swift.
View Regex.swift
//
// Regex.swift
//
// Created by Daniel Tartaglia on 2/6/16.
// Copyright © 2016 Daniel Tartaglia. MIT License.
//
import Foundation
You can’t perform that action at this time.