Skip to content

Commit 93c1fbd

Browse files
jiggagfacebook-github-bot
authored andcommitted
Fix typos (RCTCustomRefreshControlProtocol) (#36363)
Summary: Fix typo `RCTCustomRefreshContolProtocol` > `RCTCustomRefreshControlProtocol` ## Changelog [INTERNAL] [FIXED] - Fixed typo RCTCustomRefreshControlProtocol Pull Request resolved: #36363 Test Plan: none Reviewed By: cortinico Differential Revision: D44024938 Pulled By: cipolleschi fbshipit-source-id: 1fbc4e75361334586e46e14ee746cbb94d230a92
1 parent c0a46c6 commit 93c1fbd

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

React/Views/RefreshControl/RCTRefreshControl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#import <React/RCTComponent.h>
1111
#import <React/RCTScrollableProtocol.h>
1212

13-
@interface RCTRefreshControl : UIRefreshControl <RCTCustomRefreshContolProtocol>
13+
@interface RCTRefreshControl : UIRefreshControl <RCTCustomRefreshControlProtocol>
1414

1515
@property (nonatomic, copy) NSString *title;
1616
@property (nonatomic, copy) RCTDirectEventBlock onRefresh;

React/Views/ScrollView/RCTScrollView.m

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
@interface RCTCustomScrollView : UIScrollView <UIGestureRecognizerDelegate>
3030

3131
@property (nonatomic, assign) BOOL centerContent;
32-
@property (nonatomic, strong) UIView<RCTCustomRefreshContolProtocol> *customRefreshControl;
32+
@property (nonatomic, strong) UIView<RCTCustomRefreshControlProtocol> *customRefreshControl;
3333
@property (nonatomic, assign) BOOL pinchGestureEnabled;
3434

3535
@end
@@ -215,14 +215,14 @@ - (void)setFrame:(CGRect)frame
215215
}
216216
}
217217

218-
- (void)setCustomRefreshControl:(UIView<RCTCustomRefreshContolProtocol> *)refreshControl
218+
- (void)setCustomRefreshControl:(UIView<RCTCustomRefreshControlProtocol> *)refreshControl
219219
{
220220
if (_customRefreshControl) {
221221
[_customRefreshControl removeFromSuperview];
222222
}
223223
_customRefreshControl = refreshControl;
224224
// We have to set this because we can't always guarantee the
225-
// `RCTCustomRefreshContolProtocol`'s superview will always be of class
225+
// `RCTCustomRefreshControlProtocol`'s superview will always be of class
226226
// `UIScrollView` like we were previously
227227
if ([_customRefreshControl respondsToSelector:@selector(setScrollView:)]) {
228228
_customRefreshControl.scrollView = self;
@@ -412,8 +412,8 @@ - (void)setRemoveClippedSubviews:(__unused BOOL)removeClippedSubviews
412412
- (void)insertReactSubview:(UIView *)view atIndex:(NSInteger)atIndex
413413
{
414414
[super insertReactSubview:view atIndex:atIndex];
415-
if ([view conformsToProtocol:@protocol(RCTCustomRefreshContolProtocol)]) {
416-
[_scrollView setCustomRefreshControl:(UIView<RCTCustomRefreshContolProtocol> *)view];
415+
if ([view conformsToProtocol:@protocol(RCTCustomRefreshControlProtocol)]) {
416+
[_scrollView setCustomRefreshControl:(UIView<RCTCustomRefreshControlProtocol> *)view];
417417
if (![view isKindOfClass:[UIRefreshControl class]] && [view conformsToProtocol:@protocol(UIScrollViewDelegate)]) {
418418
[self addScrollListener:(UIView<UIScrollViewDelegate> *)view];
419419
}
@@ -431,7 +431,7 @@ - (void)insertReactSubview:(UIView *)view atIndex:(NSInteger)atIndex
431431
- (void)removeReactSubview:(UIView *)subview
432432
{
433433
[super removeReactSubview:subview];
434-
if ([subview conformsToProtocol:@protocol(RCTCustomRefreshContolProtocol)]) {
434+
if ([subview conformsToProtocol:@protocol(RCTCustomRefreshControlProtocol)]) {
435435
[_scrollView setCustomRefreshControl:nil];
436436
if (![subview isKindOfClass:[UIRefreshControl class]] &&
437437
[subview conformsToProtocol:@protocol(UIScrollViewDelegate)]) {
@@ -486,7 +486,7 @@ - (void)layoutSubviews
486486

487487
#if !TARGET_OS_TV
488488
// Adjust the refresh control frame if the scrollview layout changes.
489-
UIView<RCTCustomRefreshContolProtocol> *refreshControl = _scrollView.customRefreshControl;
489+
UIView<RCTCustomRefreshControlProtocol> *refreshControl = _scrollView.customRefreshControl;
490490
if (refreshControl && refreshControl.isRefreshing && ![refreshControl isKindOfClass:UIRefreshControl.class]) {
491491
refreshControl.frame =
492492
(CGRect){_scrollView.contentOffset, {_scrollView.frame.size.width, refreshControl.frame.size.height}};

React/Views/ScrollView/RCTScrollableProtocol.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
/**
3434
* Denotes a view which implements custom pull to refresh functionality.
3535
*/
36-
@protocol RCTCustomRefreshContolProtocol
36+
@protocol RCTCustomRefreshControlProtocol
3737

3838
@property (nonatomic, copy) RCTDirectEventBlock onRefresh;
3939
@property (nonatomic, readonly, getter=isRefreshing) BOOL refreshing;
@@ -42,3 +42,7 @@
4242
@property (nonatomic, weak) UIScrollView *scrollView;
4343

4444
@end
45+
46+
__attribute__((deprecated("Use RCTCustomRefreshControlProtocol instead")))
47+
@protocol RCTCustomRefreshContolProtocol<RCTCustomRefreshControlProtocol>
48+
@end

0 commit comments

Comments
 (0)