- Sublime Package Control for managing packages (like the ones below)
- Github theme for colors
- Soda theme for better chrome
- Sublime ERB keyboard shortcuts for ERB tags
My user settings:
{
#import <SenTestingKit/SenTestingKit.h> | |
#import "OCMock.h" | |
#import "NLPageControlScrollViewHelper.h" | |
#pragma mark - Tests | |
@interface NLPageControlScrollViewHelperTests : SenTestCase | |
@end |
tell application "System Events" | |
if (count of (every application process whose name is "iChat")) > 0 then | |
activate application "iChat" | |
else | |
activate application "Adium" | |
end if | |
end tell |
CABasicAnimation* animation = [CABasicAnimation animationWithKeyPath:@"transform.rotation"]; | |
[animation setToValue:[NSNumber numberWithFloat:-M_PI/128]]; | |
[animation setFromValue:[NSNumber numberWithDouble:M_PI/128]]; | |
[animation setDuration:0.09]; | |
[animation setRepeatCount:NSUIntegerMax]; | |
[animation setAutoreverses:YES]; |
My user settings:
{
To conform to Apple's human-interface guidelines, you need to implement the following tasks when subclassing UIViewController
and including a UITableView
in your hierarchy (hence recreating UITableViewController
):
In -[UIViewController viewWillAppear:]
, clear the selected row (if any) by sending the -[UITableView deselectRowAtIndexPath:animated:]
message.
In -[UIViewController viewDidAppear:]
, send the -[UITableView flashScrollIndicators]
message.
The NSKeyValueObserving
addition to NSObject
adds an observe message that takes an identifying context pointer – don't use NULL
in its place.
Your superclass may observe the same key path for the same object. You need to pass along its observations, and only take actions on yours. The context pointer distinguishes which observations are yours.
static void *kContext = &kContext;
// Pipe-forward operators that unwrap Optional values | |
operator infix |>! { precedence 50 associativity left } | |
operator infix |>& { precedence 50 associativity left } | |
// Unwrap the optional value on the left-hand side and apply the right-hand-side function | |
public func |>! <T,U>(lhs: T?, rhs: T -> U) -> U { | |
return rhs(lhs!) | |
} | |
// If optional value is nil, return nil; otherwise unwrap it and |
To form a parent-child relationship:
-addChildViewController:
message to the parent with the child as the parameter. This will send the -willMoveToParentViewController:
message to the child with the parent as the parameter.view
as a subview to the parent view controller's view
.-didMoveToParentViewController:
message to the child with the parent as the parameter.For example,
[parent addChildViewController:child];
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context | |
{ | |
if (object == self && context == self.kvoContext) { | |
((void (^)(void)) @{ | |
@"addresses": ^{ self.peep.address = [self dictionaryForArrayOfValues:self.addresses]; }, | |
@"emails": ^{ self.peep.email = [self dictionaryForArrayOfValues:self.emails]; }, | |
}[keyPath] ?: ^{})(); | |
} | |
else if (object == self.peep && context == self.kvoContext) { | |
((void (^)(void)) @{ |
RACSequence
, RACSignal
RACSignal
, RACCommand
RACCommand
, RefCount()
RACScheduler
would seem to apply here, but execution could become interleaved and thus not serialRACMulticastConnection
with a RACReplaySubject
, RACSequence
RACCommand
, RACReplaySubject
RACCommand
, RACSubject