View rotation notifications

http://stackoverflow.com/questions/6111013/view-rotation-notifications-why-didrotatefrominterfaceorientation-doesnt-get

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didRotate:) name:UIDeviceOrientationDidChangeNotification object:nil];

- (void) didRotate:(NSNotification *)notification
{
    UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
    
    if (orientation == UIDeviceOrientationLandscapeLeft)
    {
        NSLog(@"Landscape Left!");
    }
}

你可能感兴趣的:(ios,rotation)