This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface SLFLegislator : NSManagedObject | |
@property (nonatomic, retain) NSString * legID; // primary key | |
@property (nonatomic, retain) NSSet *positions; // to-many SLFCommitteePositions | |
@property (nonatomic, retain) NSString * suffixes; | |
@property (nonatomic, retain) NSString * party; | |
@property (nonatomic, retain) NSString * district; | |
@property (nonatomic, retain) NSNumber * active; | |
@property (nonatomic, retain) NSString * country; | |
@property (nonatomic, retain) NSString * stateID; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Open States API - Data for all state legislatures (well, 38 states so far) | |
* API documentation, method listing, and example GISTs at: | |
* http://openstates.sunlightlabs.com/api/ | |
* | |
* Base URL = http://openstates.sunlightlabs.com/api/v1 | |
* NOTE: All GET requests to this base URL must include an 'apikey' query parameter. | |
* | |
* My API key looks like this "/districts/tx?apikey=350284d0c6af453b9b56f6c1c7fea1f9" | |
* | |
* Resource Path Examples: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This would be inserted somewhere in your app-wide tableviewcontroller superclass configuration, to reap the benefits across all subsequent tables. | |
self.tableController.heightForHeaderInSection = 22; | |
self.tableController.onViewForHeaderInSection = ^UIView*(NSUInteger sectionIndex, NSString* sectionTitle) { | |
UIView* headerView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, self.tableView.bounds.size.width, 22)] autorelease]; | |
headerView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"sectionheader_bg.png"]]; | |
UILabel* label = [[UILabel alloc] initWithFrame:CGRectMake(5, 0, self.tableView.bounds.size.width, 22)]; | |
label.text = sectionTitle; | |
label.textColor = [UIColor whiteColor]; | |
label.backgroundColor = [UIColor clearColor]; | |
label.font = [UIFont boldSystemFontOfSize:12]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)itShouldLoadFromNetworkUpdatingFromEmptyToFullWithSections { | |
[self bootstrapEmptyStoreAndCache]; | |
[self stubObjectManagerToOnline]; | |
UITableView* tableView = [UITableView new]; | |
RKFetchedResultsTableControllerSpecViewController* viewController = [RKFetchedResultsTableControllerSpecViewController new]; | |
RKFetchedResultsTableController* tableController = | |
[[RKFetchedResultsTableController alloc] initWithTableView:tableView viewController:viewController]; | |
tableController.resourcePath = @"/JSON/humans/all.json"; | |
tableController.sectionNameKeyPath = @"name"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Enhancement Request for Core Data | |
Apple Radar Issue #11130505 | |
http://openradar.appspot.com/radar?id=3173403 | |
I'd like to see an expansion of the Core Data framework that allows us to add a | |
transient property's underlying code via a block assigned on an | |
NSPropertyDescription, in order to provide an easy means to use transient properties | |
without subclassing the managed object. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// TBSplitViewController.h | |
// | |
// Created by Tyler Bunnell on 8/4/12 | |
// Released under the have fun with this and make cool stuff license. | |
// | |
#import <UIKit/UIKit.h> | |
@interface TBSplitViewController : UISplitViewController |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
// MARK: - Comparable | |
extension NSDecimalNumber: Comparable {} | |
public func ==(lhs: NSDecimalNumber, rhs: NSDecimalNumber) -> Bool { | |
return lhs.compare(rhs) == .OrderedSame | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// PRHAngleGradientFilter.h | |
// | |
// Created by Peter Hosey on 2013-01-30. | |
// Copyright (c) 2013 Peter Hosey. All rights reserved. | |
// | |
#import <QuartzCore/QuartzCore.h> | |
@interface PRHAngleGradientFilter : CIFilter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: angleGradientImage - Ported to Swift from http://stackoverflow.com/a/33991838/136582 | |
import UIKit | |
import CoreImage | |
public func angleGradientImage(size: CGSize, radius: Float?, scale: CGFloat?, colors: (start:UIColor, end:UIColor)?) -> UIImage? { | |
let gradientRadius = (radius != nil) ? radius! : Float(min(size.width,size.height) - 2) | |
let gradientScale = (scale != nil) ? scale! : UIScreen.mainScreen().scale | |
let startColor : CIColor | |
let endColor : CIColor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Taken from @jspahrsummers: | |
* | |
* To avoid preprocessor definition collisions when working with third-party frameworks | |
* try this... | |
*/ | |
#define strongify myPrefix_strongify | |
#define weakify myPrefix_weakify | |
#define onExit myPrefix_onExit |
OlderNewer