File tree 1 file changed +16
-0
lines changed
packages/share_plus/share_plus/ios/Classes
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -261,6 +261,22 @@ + (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar> *)registrar {
261
261
262
262
UIViewController *topViewController =
263
263
TopViewControllerForViewController (RootViewController ());
264
+ BOOL isCoordinateSpaceOfSourceView =
265
+ CGRectContainsRect (topViewController.view .frame , originRect);
266
+ if (!isCoordinateSpaceOfSourceView) {
267
+ result ([FlutterError
268
+ errorWithCode: @" error"
269
+ message: [NSString
270
+ stringWithFormat:
271
+ @" sharePositionOrigin: %@ must be within "
272
+ @" coordinate space of source view: %@ " ,
273
+ NSStringFromCGRect (originRect),
274
+ NSStringFromCGRect(
275
+ topViewController.view.bounds)]
276
+ details:nil]);
277
+ return ;
278
+ }
279
+
264
280
[self shareText: shareText
265
281
subject: shareSubject
266
282
withController: topViewController
You can’t perform that action at this time.
0 commit comments