ios-KRImageViewer
ios-KRImageViewer copied to clipboard
only rotate KRImageView
If you want to rotate only! your KRImageView(like Facebook) and not your whole application you can add following to your view did Load: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didRotate) name:UIDeviceOrientationDidChangeNotification object:nil];
to oberve rotation and fire a event to change only the KRImageview. And then you can rotate like you want with:
-(void)didRotate { UIDeviceOrientation deviceOrientation = [[UIDevice currentDevice] orientation];
[self.krImageViewer reloadImagesWhenRotate:deviceOrientation];
}
Its better then: -(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { [self.krImageViewer reloadImagesWhenRotate:toInterfaceOrientation]; }
Because if you have a only Portrait Mode App, you might get problems.
Thanks, Buddy.
That's really a great idea, awesome ! I fixed it and added some methods to use.