Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skipping Resize Controller #10

Open
rollinsw opened this issue Nov 2, 2013 · 5 comments
Open

Skipping Resize Controller #10

rollinsw opened this issue Nov 2, 2013 · 5 comments

Comments

@rollinsw
Copy link

rollinsw commented Nov 2, 2013

Thanks for this great library. Is there any way to skip the steps for resizing/rotating the image? My project already does all the checking for making sure the image is square and large enough.

Thanks again,
Bill

@coryalder
Copy link
Owner

Hey Bill,

Right now, if you pass a square image to the DMActivityInstagram, the current behaviour should be to show the resize/crop view for a moment and then go right to the UIDocumentInteractionController. If you'd like skip the resize/crop view entirely, your best bet is probably to subclass DMActivityInstagram so you can return nil from it's -activityViewController method, which will prevent the resize controller from being shown. That should be enough get what you want, but I've not built it to perform that way so you may want to do some QC on that and make sure it doesn't muck anything else up.

A pull request with this behaviour as an optional feature would be welcomed :)

@rollinsw
Copy link
Author

rollinsw commented Nov 3, 2013

Thanks for the response! I've tried returning nil from activityViewControllerand the default behavior correctly calls the performActivity method. The UIDocumentInteractionController doesn't open, however, because I think it is expecting to be opened via a button on the ResizerViewController.

I'm not sure exactly how to get the document controller to open, I'll take a look at that further.

Thanks,
Bill

@coryalder
Copy link
Owner

DMActivityInstagram has a property (presentFromButton) that accepts a UIBarButtonItem to present the document interaction controller from. Try setting that, if you have a bar button you can use. Otherwise you'll have to modify - (void)performActivity, specifically the last line where it presents the document interaction controller.

On Nov 3, 2013, at 5:56 AM, Bill Rollins [email protected] wrote:

Thanks for the response! I've tried returning nil from activityViewControllerand the default behavior correctly calls the performActivity method. The UIDocumentInteractionController doesn't open, however, because I think it is expecting to be opened via a button on the ResizerViewController.

I'm not sure exactly how to get the document controller to open, I'll take a look at that further.

Thanks,
Bill


Reply to this email directly or view it on GitHub.

@DimaVartanian
Copy link

If you don't have a UIBarButtonItem that you can use, you can actually just present the UIDocumentInteractionController using - (BOOL)presentOpenInMenuFromRect:(CGRect)rect inView:(UIView *)view animated:(BOOL)animated. Pass in CGRectZero and the view of your UIActivityViewController. Works great.

@ortizroberto
Copy link

Hi @DimaVartanian @coryalder @rollinsw , could you give a little example code on how to accomplish this? I really can not get this to work without showing the resize controller.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants