Skip to content
This repository has been archived by the owner on Nov 29, 2022. It is now read-only.

editor will not work if I don't have a navigation controller. #73

Open
mibi-b opened this issue May 5, 2015 · 0 comments
Open

editor will not work if I don't have a navigation controller. #73

mibi-b opened this issue May 5, 2015 · 0 comments

Comments

@mibi-b
Copy link

mibi-b commented May 5, 2015

For the class DZNPhotoEditorContainerView sometimes I do not have a navigation controller.

The addition of checking if a bounds was returned enabled the editor to work in my app.

For example everyplace there is self.navigationController.view.bounds I then check if bounds has a size with

    CGRect bounds = self.navigationController.view.bounds;

    if ( CGRectGetWidth(bounds) == 0 ) {
        bounds = self.view.bounds;
    }

This affects squareOverlayMask, squareOverlayMask, and editedImage.

I hope this can help someone else.

- (UIImage *)squareOverlayMask
{
    // Constants
    CGRect bounds = self.navigationController.view.bounds;

    if ( CGRectGetWidth(bounds) == 0 ) {
        bounds = self.view.bounds;
    }



- (UIImage *)circularOverlayMask
{
    // Constants
    CGRect bounds = self.navigationController.view.bounds;

    if ( CGRectGetWidth(bounds) == 0 ) {
        bounds = self.view.bounds;
    }


- (UIImage *)editedImage
{
    UIImage *image = nil;

    CGRect viewRect = self.navigationController.view.bounds;

    if ( CGRectGetWidth(viewRect) == 0 ) {
        viewRect = self.view.bounds;
    }

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

No branches or pull requests

1 participant