-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from wordpress-mobile/issue/ios_recycler_cells_…
…implementation iOS recycler cells implementation
- Loading branch information
Showing
12 changed files
with
478 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
// | ||
|
||
#import <React/RCTBridgeModule.h> | ||
#import <React/RCTView.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
|
||
#import "RNRecyclerListItemViewManager.h" | ||
#import <React/RCTBridge.h> | ||
#import <React/RCTUIManager.h> | ||
#import <React/RCTConvert.h> | ||
|
||
typedef void (^ListItemViewBlock)(RecyclerListItemView *listItemView); | ||
|
||
@implementation RNRecyclerListItemViewManager | ||
|
||
RCT_EXPORT_MODULE() | ||
|
||
- (dispatch_queue_t)methodQueue | ||
{ | ||
return dispatch_get_main_queue(); | ||
} | ||
|
||
- (UIView *)view | ||
{ | ||
return [[RecyclerListItemView alloc] init]; | ||
} | ||
|
||
- (void)executeBlock:(ListItemViewBlock)block onNode:(NSNumber *)node { | ||
|
||
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) { | ||
id view = viewRegistry[node]; | ||
if (![view isKindOfClass:[RecyclerListItemView class]]) { | ||
RCTLogError(@"Invalid view returned from registry, expecting RNReactNativeTableView, got: %@", view); | ||
return; | ||
} | ||
RecyclerListItemView *item = view; | ||
if (block) { | ||
block(item); | ||
} | ||
}]; | ||
} | ||
|
||
RCT_CUSTOM_VIEW_PROPERTY(itemIndex, NSInteger, RecyclerListItemView) | ||
{ | ||
view.itemIndex = [RCTConvert NSInteger:json]; | ||
} | ||
|
||
RCT_CUSTOM_VIEW_PROPERTY(itemKey, NSInteger, RecyclerListItemView) | ||
{ | ||
view.itemKey = [RCTConvert NSInteger:json]; | ||
} | ||
|
||
|
||
@end | ||
|
Oops, something went wrong.