Last active
June 2, 2017 12:26
-
-
Save imgly-gists/656cdebd5fe999e1535c395dba9ae3fa to your computer and use it in GitHub Desktop.
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
- (void)present:(CDVInvokedUrlCommand *)command { | |
if (self.lastCommand == nil) { | |
self.lastCommand = command; | |
PESDKConfiguration *configuration = [[PESDKConfiguration alloc] initWithBuilder:^(PESDKConfigurationBuilder * _Nonnull builder) { | |
// Customize the SDK to match your requirements: | |
// ...eg.: | |
// [builder setBackgroundColor:[UIColor whiteColor]]; | |
}]; | |
PESDKCameraViewController *cameraViewController = [[PESDKCameraViewController alloc] initWithConfiguration:configuration]; | |
[cameraViewController setCompletionBlock:^(UIImage * _Nullable image, NSURL * _Nullable url) { | |
PESDKPhotoEditViewController *photoEditViewController = [[PESDKPhotoEditViewController alloc] initWithPhoto:image configuration:configuration]; | |
photoEditViewController.delegate = self; | |
PESDKToolbarController *toolbarController = [PESDKToolbarController new]; | |
[toolbarController pushViewController:photoEditViewController animated:YES completion:nil]; | |
[self.viewController dismissViewControllerAnimated:YES completion:^{ | |
[self.viewController presentViewController:toolbarController animated:YES completion:nil]; | |
}]; | |
}]; | |
dispatch_async(dispatch_get_main_queue(), ^{ | |
[self.viewController presentViewController:cameraViewController animated:YES completion:nil]; | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment