Skip to content

Commit c759b71

Browse files
committed
fix: format
1 parent 0143064 commit c759b71

File tree

2 files changed

+37
-38
lines changed

2 files changed

+37
-38
lines changed

ios/RNCChangeEvent.m

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
#import <React/RCTAssert.h>
33

44
@implementation RNCChangeEvent {
5-
UIEdgeInsets _insets;
6-
CGRect _frame;
7-
uint16_t _coalescingKey;
5+
UIEdgeInsets _insets;
6+
CGRect _frame;
7+
uint16_t _coalescingKey;
88
}
99

1010
@synthesize eventName = _eventName;
@@ -16,41 +16,41 @@ - (instancetype)initWithEventName:(NSString *)eventName
1616
frame:(CGRect)frame
1717
coalescingKey:(uint16_t)coalescingKey
1818
{
19-
RCTAssertParam(reactTag);
20-
21-
if ((self = [super init])) {
22-
_eventName = [eventName copy];
23-
_viewTag = reactTag;
24-
_frame = frame;
25-
_insets = insets;
26-
_coalescingKey = coalescingKey;
27-
}
28-
29-
return self;
19+
RCTAssertParam(reactTag);
20+
21+
if ((self = [super init])) {
22+
_eventName = [eventName copy];
23+
_viewTag = reactTag;
24+
_frame = frame;
25+
_insets = insets;
26+
_coalescingKey = coalescingKey;
27+
}
28+
29+
return self;
3030
}
3131

3232
RCT_NOT_IMPLEMENTED(-(instancetype)init)
3333

3434
- (uint16_t)coalescingKey
3535
{
36-
return _coalescingKey;
36+
return _coalescingKey;
3737
}
3838

3939
- (NSDictionary *)body
4040
{
4141
NSDictionary *body = @{
42-
@"insets" : @{
43-
@"top" : @(_insets.top),
44-
@"right" : @(_insets.right),
45-
@"bottom" : @(_insets.bottom),
46-
@"left" : @(_insets.left),
47-
},
48-
@"frame" : @{
49-
@"x" : @(_frame.origin.x),
50-
@"y" : @(_frame.origin.y),
51-
@"width" : @(_frame.size.width),
52-
@"height" : @(_frame.size.height),
53-
},
42+
@"insets" : @{
43+
@"top" : @(_insets.top),
44+
@"right" : @(_insets.right),
45+
@"bottom" : @(_insets.bottom),
46+
@"left" : @(_insets.left),
47+
},
48+
@"frame" : @{
49+
@"x" : @(_frame.origin.x),
50+
@"y" : @(_frame.origin.y),
51+
@"width" : @(_frame.size.width),
52+
@"height" : @(_frame.size.height),
53+
},
5454
};
5555

5656
return body;
@@ -75,5 +75,5 @@ - (NSArray *)arguments
7575
{
7676
return @[ self.viewTag, RCTNormalizeInputEventName(self.eventName), [self body] ];
7777
}
78-
78+
7979
@end

ios/RNCSafeAreaProvider.m

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#import "RNCSafeAreaProvider.h"
22

3-
#import <React/RCTEventDispatcher.h>
43
#import <React/RCTBridge.h>
4+
#import <React/RCTEventDispatcher.h>
55
#import <React/RCTUIManager.h>
66
#import "RCTUIManagerObserverCoordinator.h"
7-
#import "RNCSafeAreaUtils.h"
87
#import "RNCChangeEvent.h"
8+
#import "RNCSafeAreaUtils.h"
99

1010
@interface RNCSafeAreaProvider () <RCTUIManagerObserver>
1111

@@ -20,11 +20,11 @@ @implementation RNCSafeAreaProvider {
2020

2121
- (instancetype)initWithEventDispatcher:(id<RCTEventDispatcherProtocol>)eventDispatcher
2222
{
23-
RCTAssertParam(eventDispatcher);
24-
25-
if ((self = [super initWithFrame:CGRectZero])) {
23+
RCTAssertParam(eventDispatcher);
24+
25+
if ((self = [super initWithFrame:CGRectZero])) {
2626
#if !TARGET_OS_TV && !TARGET_OS_OSX
27-
27+
2828
_eventDispatcher = eventDispatcher;
2929

3030
[NSNotificationCenter.defaultCenter addObserver:self
@@ -71,7 +71,7 @@ - (void)invalidateSafeAreaInsets
7171
safeAreaInsets = NSEdgeInsetsZero;
7272
}
7373
#endif
74-
74+
7575
CGRect frame = [self convertRect:self.bounds toView:RNCParentViewController(self).view];
7676

7777
if (_initialInsetsSent &&
@@ -88,14 +88,13 @@ - (void)invalidateSafeAreaInsets
8888
_currentFrame = frame;
8989

9090
[NSNotificationCenter.defaultCenter postNotificationName:RNCSafeAreaDidChange object:self userInfo:nil];
91-
91+
9292
RNCChangeEvent *changeEvent = [[RNCChangeEvent alloc] initWithEventName:@"onInsetsChange"
9393
reactTag:self.reactTag
9494
insets:safeAreaInsets
9595
frame:frame
9696
coalescingKey:0];
97-
98-
97+
9998
[_eventDispatcher sendEvent:changeEvent];
10099
}
101100

0 commit comments

Comments
 (0)