This file contains 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 UIKit; | |
@interface UIView (QuickLook) | |
@end | |
@implementation UIView (QuickLook) | |
- (id)debugQuickLookObject { | |
return self; |
This file contains 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/Foundation.h> | |
#define TGR_RUNLOOP_INTERVAL 0.05 | |
#define TGR_TIMEOUT_INTERVAL 1.0 | |
#define TGR_RUNLOOP_COUNT TGR_TIMEOUT_INTERVAL / TGR_RUNLOOP_INTERVAL | |
#define TGR_CAT(x, y) x ## y | |
#define TGR_TOKCAT(x, y) TGR_CAT(x, y) | |
#define __runLoopCount TGR_TOKCAT(__runLoopCount,__LINE__) |
This file contains 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/Foundation.h> | |
#import <Accounts/Accounts.h> | |
#import <CoreData/CoreData.h> | |
@interface TGRTimeline : NSObject | |
@property (strong, nonatomic, readonly) NSManagedObjectContext *managedObjectContext; | |
@property (nonatomic, readonly, getter = isLoading) BOOL loading; | |
- (id)initWithAccount:(ACAccount *)account; |
This file contains 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)importValuesFromDictionary:(NSDictionary *)dictionary | |
{ | |
self.identifier = dictionary[@"id"]; | |
self.name = dictionary[@"name"]; | |
self.screenName = dictionary[@"screen_name"]; | |
self.imageLink = dictionary[@"profile_image_url"]; | |
} |
This file contains 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
@implementation TGRTimeline | |
- (id)initWithAccount:(ACAccount *)account | |
{ | |
self = [super init]; | |
if (self) { | |
_account = account; | |
} | |
return self; | |
} |
This file contains 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
- (BOOL)loadNewTweetsWithCompletionHandler:(void (^)(NSError *error))completionHandler | |
{ | |
if (self.loading) { | |
return NO; | |
} | |
SLRequest *request = [self requestForNewTweets]; | |
[self loadTweetsWithRequest:request completionHandler:completionHandler]; | |
return YES; |
This file contains 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
- (SLRequest *)requestForNewTweets | |
{ | |
return nil; | |
} | |
- (SLRequest *)requestForOldTweets | |
{ | |
return nil; | |
} |
This file contains 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
+ (NSFetchRequest *)fetchRequestForTwitterUserWithIdentifier:(NSNumber *)identifier; | |
+ (id)twitterUserWithIdentifier:(NSNumber *)identifier | |
inManagedObjectContext:(NSManagedObjectContext *)context; |
This file contains 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
+ (NSFetchRequest *)fetchRequestForTwitterUserWithIdentifier:(NSNumber *)identifier | |
{ | |
static dispatch_once_t onceToken; | |
static NSPredicate *predicateTemplate; | |
dispatch_once(&onceToken, ^{ | |
predicateTemplate = [NSPredicate predicateWithFormat:@"identifier == $IDENTIFIER"]; | |
}); | |
NSPredicate *predicate = [predicateTemplate predicateWithSubstitutionVariables: |
This file contains 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 "TGRManagedObject.h" | |
@class TGRTwitterUser; | |
@interface TGRTweet : TGRManagedObject | |
... |
OlderNewer