Fix typos (RCTCustomRefreshControlProtocol) (#36363)

Summary:
Fix typo `RCTCustomRefreshContolProtocol` > `RCTCustomRefreshControlProtocol`

## Changelog

[INTERNAL] [FIXED] - Fixed typo RCTCustomRefreshControlProtocol

Pull Request resolved: https://github.com/facebook/react-native/pull/36363

Test Plan: none

Reviewed By: cortinico

Differential Revision: D44024938

Pulled By: cipolleschi

fbshipit-source-id: 1fbc4e75361334586e46e14ee746cbb94d230a92
This commit is contained in:
jiggag
2023-03-16 09:47:31 -07:00
committed by Facebook GitHub Bot
parent c0a46c696b
commit 93c1fbd2d8
3 changed files with 13 additions and 9 deletions
@@ -10,7 +10,7 @@
#import <React/RCTComponent.h>
#import <React/RCTScrollableProtocol.h>
@interface RCTRefreshControl : UIRefreshControl <RCTCustomRefreshContolProtocol>
@interface RCTRefreshControl : UIRefreshControl <RCTCustomRefreshControlProtocol>
@property (nonatomic, copy) NSString *title;
@property (nonatomic, copy) RCTDirectEventBlock onRefresh;
+7 -7
View File
@@ -29,7 +29,7 @@
@interface RCTCustomScrollView : UIScrollView <UIGestureRecognizerDelegate>
@property (nonatomic, assign) BOOL centerContent;
@property (nonatomic, strong) UIView<RCTCustomRefreshContolProtocol> *customRefreshControl;
@property (nonatomic, strong) UIView<RCTCustomRefreshControlProtocol> *customRefreshControl;
@property (nonatomic, assign) BOOL pinchGestureEnabled;
@end
@@ -215,14 +215,14 @@
}
}
- (void)setCustomRefreshControl:(UIView<RCTCustomRefreshContolProtocol> *)refreshControl
- (void)setCustomRefreshControl:(UIView<RCTCustomRefreshControlProtocol> *)refreshControl
{
if (_customRefreshControl) {
[_customRefreshControl removeFromSuperview];
}
_customRefreshControl = refreshControl;
// We have to set this because we can't always guarantee the
// `RCTCustomRefreshContolProtocol`'s superview will always be of class
// `RCTCustomRefreshControlProtocol`'s superview will always be of class
// `UIScrollView` like we were previously
if ([_customRefreshControl respondsToSelector:@selector(setScrollView:)]) {
_customRefreshControl.scrollView = self;
@@ -412,8 +412,8 @@ static inline void RCTApplyTransformationAccordingLayoutDirection(
- (void)insertReactSubview:(UIView *)view atIndex:(NSInteger)atIndex
{
[super insertReactSubview:view atIndex:atIndex];
if ([view conformsToProtocol:@protocol(RCTCustomRefreshContolProtocol)]) {
[_scrollView setCustomRefreshControl:(UIView<RCTCustomRefreshContolProtocol> *)view];
if ([view conformsToProtocol:@protocol(RCTCustomRefreshControlProtocol)]) {
[_scrollView setCustomRefreshControl:(UIView<RCTCustomRefreshControlProtocol> *)view];
if (![view isKindOfClass:[UIRefreshControl class]] && [view conformsToProtocol:@protocol(UIScrollViewDelegate)]) {
[self addScrollListener:(UIView<UIScrollViewDelegate> *)view];
}
@@ -431,7 +431,7 @@ static inline void RCTApplyTransformationAccordingLayoutDirection(
- (void)removeReactSubview:(UIView *)subview
{
[super removeReactSubview:subview];
if ([subview conformsToProtocol:@protocol(RCTCustomRefreshContolProtocol)]) {
if ([subview conformsToProtocol:@protocol(RCTCustomRefreshControlProtocol)]) {
[_scrollView setCustomRefreshControl:nil];
if (![subview isKindOfClass:[UIRefreshControl class]] &&
[subview conformsToProtocol:@protocol(UIScrollViewDelegate)]) {
@@ -486,7 +486,7 @@ static inline void RCTApplyTransformationAccordingLayoutDirection(
#if !TARGET_OS_TV
// Adjust the refresh control frame if the scrollview layout changes.
UIView<RCTCustomRefreshContolProtocol> *refreshControl = _scrollView.customRefreshControl;
UIView<RCTCustomRefreshControlProtocol> *refreshControl = _scrollView.customRefreshControl;
if (refreshControl && refreshControl.isRefreshing && ![refreshControl isKindOfClass:UIRefreshControl.class]) {
refreshControl.frame =
(CGRect){_scrollView.contentOffset, {_scrollView.frame.size.width, refreshControl.frame.size.height}};
@@ -33,7 +33,7 @@
/**
* Denotes a view which implements custom pull to refresh functionality.
*/
@protocol RCTCustomRefreshContolProtocol
@protocol RCTCustomRefreshControlProtocol
@property (nonatomic, copy) RCTDirectEventBlock onRefresh;
@property (nonatomic, readonly, getter=isRefreshing) BOOL refreshing;
@@ -42,3 +42,7 @@
@property (nonatomic, weak) UIScrollView *scrollView;
@end
__attribute__((deprecated("Use RCTCustomRefreshControlProtocol instead")))
@protocol RCTCustomRefreshContolProtocol<RCTCustomRefreshControlProtocol>
@end