Skip to content

Commit afc23f6

Browse files
authored
Merge pull request ReactiveCocoa#27 from Lightricks/feature/spaces-not-tabs
ReactiveObjC: convert tabs to spaces.
2 parents 1809484 + 3977e12 commit afc23f6

File tree

142 files changed

+10168
-10168
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+10168
-10168
lines changed

ReactiveObjC/MKAnnotationView+RACSignalSupport.m

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@
1616
@implementation MKAnnotationView (RACSignalSupport)
1717

1818
- (RACSignal *)rac_prepareForReuseSignal {
19-
RACSignal *signal = objc_getAssociatedObject(self, _cmd);
20-
if (signal != nil) return signal;
19+
RACSignal *signal = objc_getAssociatedObject(self, _cmd);
20+
if (signal != nil) return signal;
2121

22-
signal = [[[self
23-
rac_signalForSelector:@selector(prepareForReuse)]
24-
mapReplace:RACUnit.defaultUnit]
25-
setNameWithFormat:@"%@ -rac_prepareForReuseSignal", RACDescription(self)];
22+
signal = [[[self
23+
rac_signalForSelector:@selector(prepareForReuse)]
24+
mapReplace:RACUnit.defaultUnit]
25+
setNameWithFormat:@"%@ -rac_prepareForReuseSignal", RACDescription(self)];
2626

27-
objc_setAssociatedObject(self, _cmd, signal, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
28-
return signal;
27+
objc_setAssociatedObject(self, _cmd, signal, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
28+
return signal;
2929
}
3030

3131
@end

ReactiveObjC/NSArray+RACSequenceAdditions.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
@implementation NSArray (RACSequenceAdditions)
1313

1414
- (RACSequence *)rac_sequence {
15-
return [RACArraySequence sequenceWithArray:self offset:0];
15+
return [RACArraySequence sequenceWithArray:self offset:0];
1616
}
1717

1818
@end

ReactiveObjC/NSControl+RACCommandSupport.m

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,40 +18,40 @@
1818
@implementation NSControl (RACCommandSupport)
1919

2020
- (RACCommand *)rac_command {
21-
return objc_getAssociatedObject(self, NSControlRACCommandKey);
21+
return objc_getAssociatedObject(self, NSControlRACCommandKey);
2222
}
2323

2424
- (void)setRac_command:(RACCommand *)command {
25-
objc_setAssociatedObject(self, NSControlRACCommandKey, command, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
26-
27-
// Tear down any previous binding before setting up our new one, or else we
28-
// might get assertion failures.
29-
[objc_getAssociatedObject(self, NSControlEnabledDisposableKey) dispose];
30-
objc_setAssociatedObject(self, NSControlEnabledDisposableKey, nil, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
31-
32-
if (command == nil) {
33-
self.enabled = YES;
34-
return;
35-
}
36-
37-
[self rac_hijackActionAndTargetIfNeeded];
38-
39-
RACScopedDisposable *disposable = [[command.enabled setKeyPath:@"enabled" onObject:self] asScopedDisposable];
40-
objc_setAssociatedObject(self, NSControlEnabledDisposableKey, disposable, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
25+
objc_setAssociatedObject(self, NSControlRACCommandKey, command, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
26+
27+
// Tear down any previous binding before setting up our new one, or else we
28+
// might get assertion failures.
29+
[objc_getAssociatedObject(self, NSControlEnabledDisposableKey) dispose];
30+
objc_setAssociatedObject(self, NSControlEnabledDisposableKey, nil, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
31+
32+
if (command == nil) {
33+
self.enabled = YES;
34+
return;
35+
}
36+
37+
[self rac_hijackActionAndTargetIfNeeded];
38+
39+
RACScopedDisposable *disposable = [[command.enabled setKeyPath:@"enabled" onObject:self] asScopedDisposable];
40+
objc_setAssociatedObject(self, NSControlEnabledDisposableKey, disposable, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
4141
}
4242

4343
- (void)rac_hijackActionAndTargetIfNeeded {
44-
SEL hijackSelector = @selector(rac_commandPerformAction:);
45-
if (self.target == self && self.action == hijackSelector) return;
46-
47-
if (self.target != nil) NSLog(@"WARNING: NSControl.rac_command hijacks the control's existing target and action.");
48-
49-
self.target = self;
50-
self.action = hijackSelector;
44+
SEL hijackSelector = @selector(rac_commandPerformAction:);
45+
if (self.target == self && self.action == hijackSelector) return;
46+
47+
if (self.target != nil) NSLog(@"WARNING: NSControl.rac_command hijacks the control's existing target and action.");
48+
49+
self.target = self;
50+
self.action = hijackSelector;
5151
}
5252

5353
- (void)rac_commandPerformAction:(id)sender {
54-
[self.rac_command execute:sender];
54+
[self.rac_command execute:sender];
5555
}
5656

5757
@end

ReactiveObjC/NSControl+RACTextSignalSupport.m

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,23 @@
1616
@implementation NSControl (RACTextSignalSupport)
1717

1818
- (RACSignal *)rac_textSignal {
19-
@rac_weakify(self);
20-
return [[[[RACSignal
21-
createSignal:^(id<RACSubscriber> subscriber) {
22-
@rac_strongify(self);
23-
id observer = [NSNotificationCenter.defaultCenter addObserverForName:NSControlTextDidChangeNotification object:self queue:nil usingBlock:^(NSNotification *note) {
24-
[subscriber sendNext:note.object];
25-
}];
19+
@rac_weakify(self);
20+
return [[[[RACSignal
21+
createSignal:^(id<RACSubscriber> subscriber) {
22+
@rac_strongify(self);
23+
id observer = [NSNotificationCenter.defaultCenter addObserverForName:NSControlTextDidChangeNotification object:self queue:nil usingBlock:^(NSNotification *note) {
24+
[subscriber sendNext:note.object];
25+
}];
2626

27-
return [RACDisposable disposableWithBlock:^{
28-
[NSNotificationCenter.defaultCenter removeObserver:observer];
29-
}];
30-
}]
31-
map:^(NSControl *control) {
32-
return [control.stringValue copy];
33-
}]
34-
startWith:[self.stringValue copy]]
35-
setNameWithFormat:@"%@ -rac_textSignal", RACDescription(self)];
27+
return [RACDisposable disposableWithBlock:^{
28+
[NSNotificationCenter.defaultCenter removeObserver:observer];
29+
}];
30+
}]
31+
map:^(NSControl *control) {
32+
return [control.stringValue copy];
33+
}]
34+
startWith:[self.stringValue copy]]
35+
setNameWithFormat:@"%@ -rac_textSignal", RACDescription(self)];
3636
}
3737

3838
@end

ReactiveObjC/NSData+RACSupport.m

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@
1313
@implementation NSData (RACSupport)
1414

1515
+ (RACSignal *)rac_readContentsOfURL:(NSURL *)URL options:(NSDataReadingOptions)options scheduler:(RACScheduler *)scheduler {
16-
NSCParameterAssert(scheduler != nil);
17-
18-
RACReplaySubject *subject = [RACReplaySubject subject];
19-
[subject setNameWithFormat:@"+rac_readContentsOfURL: %@ options: %lu scheduler: %@", URL, (unsigned long)options, scheduler];
20-
21-
[scheduler schedule:^{
22-
NSError *error = nil;
23-
NSData *data = [[NSData alloc] initWithContentsOfURL:URL options:options error:&error];
24-
if (data == nil) {
25-
[subject sendError:error];
26-
} else {
27-
[subject sendNext:data];
28-
[subject sendCompleted];
29-
}
30-
}];
31-
32-
return subject;
16+
NSCParameterAssert(scheduler != nil);
17+
18+
RACReplaySubject *subject = [RACReplaySubject subject];
19+
[subject setNameWithFormat:@"+rac_readContentsOfURL: %@ options: %lu scheduler: %@", URL, (unsigned long)options, scheduler];
20+
21+
[scheduler schedule:^{
22+
NSError *error = nil;
23+
NSData *data = [[NSData alloc] initWithContentsOfURL:URL options:options error:&error];
24+
if (data == nil) {
25+
[subject sendError:error];
26+
} else {
27+
[subject sendNext:data];
28+
[subject sendCompleted];
29+
}
30+
}];
31+
32+
return subject;
3333
}
3434

3535
@end

ReactiveObjC/NSDictionary+RACSequenceAdditions.m

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@
1414
@implementation NSDictionary (RACSequenceAdditions)
1515

1616
- (RACSequence *)rac_sequence {
17-
NSDictionary *immutableDict = [self copy];
17+
NSDictionary *immutableDict = [self copy];
1818

19-
// TODO: First class support for dictionary sequences.
20-
return [immutableDict.allKeys.rac_sequence map:^(id key) {
21-
id value = immutableDict[key];
22-
return RACTuplePack(key, value);
23-
}];
19+
// TODO: First class support for dictionary sequences.
20+
return [immutableDict.allKeys.rac_sequence map:^(id key) {
21+
id value = immutableDict[key];
22+
return RACTuplePack(key, value);
23+
}];
2424
}
2525

2626
- (RACSequence *)rac_keySequence {
27-
return self.allKeys.rac_sequence;
27+
return self.allKeys.rac_sequence;
2828
}
2929

3030
- (RACSequence *)rac_valueSequence {
31-
return self.allValues.rac_sequence;
31+
return self.allValues.rac_sequence;
3232
}
3333

3434
@end

ReactiveObjC/NSEnumerator+RACSequenceAdditions.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
@implementation NSEnumerator (RACSequenceAdditions)
1313

1414
- (RACSequence *)rac_sequence {
15-
return [RACSequence sequenceWithHeadBlock:^{
16-
return [self nextObject];
17-
} tailBlock:^{
18-
return self.rac_sequence;
19-
}];
15+
return [RACSequence sequenceWithHeadBlock:^{
16+
return [self nextObject];
17+
} tailBlock:^{
18+
return self.rac_sequence;
19+
}];
2020
}
2121

2222
@end

ReactiveObjC/NSFileHandle+RACSupport.m

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,26 @@
1515
@implementation NSFileHandle (RACSupport)
1616

1717
- (RACSignal *)rac_readInBackground {
18-
RACReplaySubject *subject = [RACReplaySubject subject];
19-
[subject setNameWithFormat:@"%@ -rac_readInBackground", RACDescription(self)];
18+
RACReplaySubject *subject = [RACReplaySubject subject];
19+
[subject setNameWithFormat:@"%@ -rac_readInBackground", RACDescription(self)];
2020

21-
RACSignal *dataNotification = [[[NSNotificationCenter defaultCenter] rac_addObserverForName:NSFileHandleReadCompletionNotification object:self] map:^(NSNotification *note) {
22-
return note.userInfo[NSFileHandleNotificationDataItem];
23-
}];
24-
25-
__block RACDisposable *subscription = [dataNotification subscribeNext:^(NSData *data) {
26-
if (data.length > 0) {
27-
[subject sendNext:data];
28-
[self readInBackgroundAndNotify];
29-
} else {
30-
[subject sendCompleted];
31-
[subscription dispose];
32-
}
33-
}];
34-
35-
[self readInBackgroundAndNotify];
36-
37-
return subject;
21+
RACSignal *dataNotification = [[[NSNotificationCenter defaultCenter] rac_addObserverForName:NSFileHandleReadCompletionNotification object:self] map:^(NSNotification *note) {
22+
return note.userInfo[NSFileHandleNotificationDataItem];
23+
}];
24+
25+
__block RACDisposable *subscription = [dataNotification subscribeNext:^(NSData *data) {
26+
if (data.length > 0) {
27+
[subject sendNext:data];
28+
[self readInBackgroundAndNotify];
29+
} else {
30+
[subject sendCompleted];
31+
[subscription dispose];
32+
}
33+
}];
34+
35+
[self readInBackgroundAndNotify];
36+
37+
return subject;
3838
}
3939

4040
@end

ReactiveObjC/NSIndexSet+RACSequenceAdditions.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
@implementation NSIndexSet (RACSequenceAdditions)
1313

1414
- (RACSequence *)rac_sequence {
15-
return [RACIndexSetSequence sequenceWithIndexSet:self];
15+
return [RACIndexSetSequence sequenceWithIndexSet:self];
1616
}
1717

1818
@end

0 commit comments

Comments
 (0)