yackle / CLImageEditor

MIT License
2.22k stars 574 forks source link

Landscape #134

Closed Tippit closed 7 years ago

Tippit commented 8 years ago

Does someone could help to make a Portrait/Landscape rotation version?

BluePick commented 7 years ago

add below code in _CLImageEditorViewController.m

- (BOOL)shouldAutorotate
{
    return YES;
}

#if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000
- (NSUInteger)supportedInterfaceOrientations
#else
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
#endif
{
    return UIInterfaceOrientationMaskAll;
}

- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
{
    [coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context)
     {
            [self refreshImageView];
     } completion:^(id<UIViewControllerTransitionCoordinatorContext> context)
     {

     }];

    [super viewWillTransitionToSize:size withTransitionCoordinator:coordinator];
}

but there some ui issue :(

Tippit commented 7 years ago

Thank's 👍

yackle commented 7 years ago

please try #183 changes.