Skip to content

Instantly share code, notes, and snippets.

View Adlai-Holler's full-sized avatar

Adlai Holler Adlai-Holler

  • Chattanooga, TN
View GitHub Profile
@Adlai-Holler
Adlai-Holler / UpdateCollectionViewOperation.swift
Created September 26, 2015 20:58
An operation to update an ASTableView/ASCollectionView from an NSFetchedResultsController changeset
/**
Abstract: An operation the apply an FRC update to a table view/collection view.
*/
import UIKit
struct CollectionUpdate {
// Note: These properties are listed in the order changes should be processed
@Adlai-Holler
Adlai-Holler / gist:ae321c3398d7db9a55c0
Created May 4, 2014 21:22
An early pod spec for ReactiveCocoa 3.0-dev
Pod::Spec.new do |s|
s.name = "ReactiveCocoa"
s.version = "3.0-dev"
s.summary = "A framework for composing and transforming streams of values."
s.homepage = "https://github.com/blog/1107-reactivecocoa-is-now-open-source"
s.author = { "Josh Abernathy" => "josh@github.com" }
s.source = { :git => "https://github.com/ReactiveCocoa/ReactiveCocoa.git", :branch => "3.0-development" }
s.license = 'MIT'
s.description = "ReactiveCocoa (RAC) is an Objective-C framework for Functional Reactive Programming. It provides APIs for composing and transforming streams of values."
@implementation UINavigationController(Trim)
-(void)trimNavigationStack {
NSArray *vcs = [self.viewControllers subArrayWithRange:NSMakeRange(0,self.viewControllers.count - 1)];
NSString *file = [NSTemporaryDirectory() stringByAppendingPathComponent:@"trimmedVCs"];
[NSKeyedArchiver archiveRootObject:vcs toFile:file];
[self setViewControllers:@[self.viewControllers.lastObject] animated:NO];
}
-(void)untrimNavigationStack {
/** Public, and safe since UIKit is single-threaded */
+(instancetype)controllerWithParam:(id)param0 {
nextParam0 = param0;
id vc = [[UIStoryboard storyboard…] instantiateViewController…];
return vc;
}
static id nextParam0;
-(id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
if(!self) return nil;