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.
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];
}
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.