mirror of
https://github.com/status-im/react-native.git
synced 2025-01-09 17:15:54 +00:00
44f7a00e95
Summary: Both iOS and Android currently support some sort of native pull to refresh control but the API was very different. I tried implementing a component based on PullToRefreshViewAndroid but that works on both platforms. I liked the idea of wrapping the ListView or ScrollView with the PullToRefreshView component and allow styling the refresh view with platform specific props if needed. I also like the fact that 'refreshing' is a controlled prop so there is no need to keep a ref to the component or to the stopRefreshing function. It is a pretty rough start so I'm looking for feedback and ideas to improve on the API before cleaning up everything. On iOS we could probably deprecate the onRefreshStart property of the ScrollView and implement the native stuff in a PullToRefreshViewManager. We could then add props to customize the look of the UIRefreshControl (tintColor). We could also deprecate the Android only component and remove it later. Closes https://github.com/facebook/react-native/pull/4915 Reviewed By: svcscm Differential Revision: D2799246 Pulled By: nicklockwood fb-gh-sync-id: 75872c12143ddbc05cc91900ab4612e477ca5765
20 lines
520 B
Objective-C
20 lines
520 B
Objective-C
/**
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*/
|
|
|
|
#import <UIKit/UIKit.h>
|
|
|
|
#import "RCTComponent.h"
|
|
|
|
@interface RCTRefreshControl : UIRefreshControl
|
|
|
|
@property (nonatomic, copy) NSString *title;
|
|
@property (nonatomic, copy) RCTDirectEventBlock onRefresh;
|
|
|
|
@end
|