Commit 3f2dc198 authored by Gaëtan Renaudeau's avatar Gaëtan Renaudeau

drop old RN version since 0.16 is a breaking changes

parent db5946fd
#import "GLCanvasManager.h"
#import "GLCanvas.h"
#import "RCTConvert+GLData.h"
#import "RCTSparseArray.h"
#import "RCTUIManager.h"
#import "RCTLog.h"
#import <UIKit/UIKit.h>
......@@ -32,14 +31,15 @@ RCT_EXPORT_VIEW_PROPERTY(onChange, BOOL);
RCT_EXPORT_METHOD(capture: (nonnull NSNumber *)reactTag callback:(RCTResponseSenderBlock)callback)
{
[self.bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, RCTSparseArray *viewRegistry) {
GLCanvas *view = viewRegistry[reactTag];
[self.bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
UIView *view = viewRegistry[reactTag];
if (![view isKindOfClass:[GLCanvas class]]) {
RCTLog(@"expecting UIView, got: %@", view);
callback(@[@"view is not a GLCanvas"]);
}
else {
[view capture:callback];
GLCanvas *glCanvas = (GLCanvas *)view;
[glCanvas capture:callback];
}
}];
}
......
......@@ -89,13 +89,14 @@ RCT_NOT_IMPLEMENTED(-init)
scale:0
resizeMode:UIViewContentModeScaleToFill
progressBlock:nil
completionBlock:^(NSError *error, id image) {
completionBlock:^(NSError *error, UIImage *image) {
_loading = nil;
[self clearImage];
if (error) {
NSLog(@"Image failed to load: %@", error);
} else {
self.image = image;
// we need to copy the image because it seems the image will be altered.
self.image = [UIImage imageWithCGImage:image.CGImage];
if(_onload) _onload();
}
}];
......
#import "RNGLContext.h"
#import "RCTConvert.h"
#import "RCTLog.h"
......
......@@ -19,7 +19,7 @@
"author": "Project September <tech@projectseptember.com>",
"license": "MIT",
"peerDependencies": {
"react-native": ">=0.13.0 <0.16.0",
"react-native": "0.16.0-rc || >=0.16.0",
"gl-react": ">= 2.0.0"
},
"dependencies": {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment