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
| // | |
| // MFMessageComposeViewController+RAC.m | |
| // Three Cents | |
| // | |
| // Created by Bob Spryn on 3/3/14. | |
| // Copyright (c) 2014 Three Cents, Inc. All rights reserved. | |
| // | |
| #import "MFMessageComposeViewController+RAC.h" | |
| #import <objc/objc-runtime.h> |
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
| self.accountStore = [[ACAccountStore alloc] init]; | |
| self.pickTwitterAccountCommand = [[RACCommand alloc] initWithSignalBlock:^RACSignal *(ACAccount *account) { | |
| return [RACSignal return:account]; | |
| }]; | |
| // Returns an error we handle when they cancel picking from multiple twitter accounts | |
| RACSignal *cancelledPickingTwitterAccount = [[[self.pickTwitterAccountCommand.executionSignals switchToLatest] | |
| filter:^BOOL(ACAccount *account) { | |
| return account == nil; |
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)viewDidLoad | |
| { | |
| [super viewDidLoad]; | |
| DeviceSettingsHeaderView *headerView = [[DeviceSettingsHeaderView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, self.tableView.bounds.size.width, DEVICE_HEADER_HEIGHT)]; | |
| // don't need this with the current code | |
| // RACSignal *newDevice = [RACObserve(self, device) ignore: nil]; | |
| // When the battery level changes, update the string |
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
| // | |
| // TCAnswerDetailTitleDetailCell.m | |
| // Three Cents | |
| // | |
| // Created by Bob Spryn on 4/11/13. | |
| // Copyright (c) 2013 Three Cents, Inc. All rights reserved. | |
| // | |
| #import "TCAnswerDetailTitleDetailCell.h" |
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)viewDidLoad | |
| { | |
| [super viewDidLoad]; | |
| @weakify(self); | |
| self.exploreSearchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, mTCTableViewFrameWidth, 44)]; | |
| self.exploreSearchBar.placeholder = @"Search"; | |
| self.exploreSearchBar.delegate = self; | |
| [self.exploreSearchBar setBackgroundImage:[UIImage squareImageWithColor:mTCLightTanColor dimension:1] forBarPosition:UIBarPositionAny barMetrics:UIBarMetricsDefault]; |
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) init { | |
| [super init]; | |
| self.activityItemsTableChangeSignal = [[[RACSignal zip:@[[RACObserve(self, activityItems) ignore:nil], | |
| [RACObserve(self, previousActivityItems) ignore:nil]]] | |
| skip:1] | |
| reduceEach:^id (NSOrderedSet *activityItems, NSOrderedSet *previousActivityItems){ | |
| return [self generateChangeSetsForSection:kTCTableUpdateSectionActivity withNewObjects:activityItems fromOldObjects:previousActivityItems]; | |
| }]; | |
| } |
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
| // delegate methods | |
| - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
| } | |
| - (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { | |
| } | |
| // block based callbacks | |
| [TCAPI getCategoriesModifiedSince:date onComplete:^(NSArray *objects, RKObjectRequestOperation *operation, NSError *error) { | |
| }]; | |
| // target action | |
| - (IBAction)doneAction:(id)sender { |
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) viewDidLoad { | |
| [super viewDidLoad]; | |
| self.fetchUserMenuDataCommand = [[RACCommand alloc] initWithSignalBlock:^RACSignal *(id input) { | |
| return [TCAPI fetchUserMenuData]; | |
| }]; | |
| RAC(self, menuData) = [self.fetchUserMenuDataCommand.executionSignals switchToLatest]; | |
| RACSignal *userIsLoggedInSignal = [[[[NSNotificationCenter defaultCenter] rac_addObserverForName:kUserLoggedOutNotification object:nil] |
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 MYTwitterLookupViewModel: NSObject | |
| @property (nonatomic, assign, readonly, getter=isUsernameValid) BOOL usernameValid; | |
| @property (nonatomic, strong, readonly) NSString *userFullName; | |
| @property (nonatomic, strong, readonly) UIImage *userAvatarImage; | |
| @property (nonatomic, strong, readonly) NSArray *tweets; | |
| @property (nonatomic, assign, readonly) BOOL allTweetsLoaded; | |
| @property (nonatomic, strong, readwrite) NSString *username; |