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
- (id)initWithFrame:(CGRect)rect { | |
self = [super initWithFrame:rect]; | |
if (self == nil) return nil; | |
[self initializeComponent]; | |
RAC(self.title.text) = RACAble(self.viewModel.model.title); | |
RAC(self.userAndOrgTiles.itemSource) = RACAble(self.viewModel.userAndOrgTiles); | |
self.loginButton.rac_command = self.viewModel.showLoginCommand; |
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
- (RACSignal*)friendsId | |
{ | |
return [self enqueueWithCursor:-1]; | |
} | |
- (RACSignal*)enqueueWithCursor:(NSInteger)cursor | |
{ | |
@weakify(self); | |
return [[self idsAtCursor:cursor] | |
// Map each `next` (there should only be one) to a new signal. |
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
[NSWindow ex_patchInstanceSelector: @selector(sendEvent:) withReplacementBlock: ^(EXPatchIMP *patch) { | |
return ^(NSEvent *event) { | |
NSWindow *window = (__bridge NSWindow *) patch->self; | |
if (window != self.window && [event type] == NSLeftMouseUp && [window isKeyWindow]) { | |
/* The last view seen */ | |
static NSView *lastView = nil; | |
NSPoint point = [window.contentView convertPoint: [event locationInWindow] fromView: nil]; | |
NSView *hitView = [window.contentView hitTest: point]; |
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 iflet(LHS, RHS) \ | |
for (id obj_ = (RHS); obj_ != nil;) \ | |
for (LHS = (obj_ ?: (RHS)); obj_ != nil; obj_ = nil) | |
int main(int argc, char *argv[]) { | |
@autoreleasepool { | |
NSString *x = nil; | |
NSString *y = @"y"; |