ios 监听设备旋转方向

-(void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
    if(fromInterfaceOrientation == UIInterfaceOrientationLandscapeLeft || fromInterfaceOrientation == UIInterfaceOrientationLandscapeRight)
    {
       
    }

     if (self.interfaceOrientation == UIDeviceOrientationPortrait){

        NSLog(@"竖直");

    }

    elseif(self.interfaceOrientation == UIDeviceOrientationLandscapeLeft)

    {

        NSLog(@"水平向左");

    }

    elseif(self.interfaceOrientation == UIDeviceOrientationLandscapeLeft)

    {

        NSLog(@"水平向左");

    }

}
原文地址:https://www.cnblogs.com/lihaibo-Leao/p/3284723.html