From 2ce6ce8991b8dbd2a6aaa0b2f6648a85fb88f90b Mon Sep 17 00:00:00 2001 From: Aleksei Savitski Date: Fri, 8 Nov 2019 16:48:48 +0300 Subject: [PATCH] Apply custom options after custom aspect ratio is set --- ios/Classes/ImageCropperPlugin.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/Classes/ImageCropperPlugin.m b/ios/Classes/ImageCropperPlugin.m index a1049295..d77532ee 100644 --- a/ios/Classes/ImageCropperPlugin.m +++ b/ios/Classes/ImageCropperPlugin.m @@ -73,8 +73,6 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result { } cropViewController.allowedAspectRatios = allowedAspectRatios; - [self setupUiCustomizedOptions:call.arguments forViewController:cropViewController]; - if (ratioX != (id)[NSNull null] && ratioY != (id)[NSNull null]) { cropViewController.customAspectRatio = CGSizeMake([ratioX floatValue], [ratioY floatValue]); cropViewController.resetAspectRatioEnabled = NO; @@ -83,6 +81,8 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result { cropViewController.aspectRatioLockEnabled = YES; } + [self setupUiCustomizedOptions:call.arguments forViewController:cropViewController]; + [_viewController presentViewController:cropViewController animated:YES completion:nil]; } else { result(FlutterMethodNotImplemented);