Q: How can I access interfaceOrientation in a custom CALayer? I am have a custom CALayer which should look different with respect to different interface orientation.
Is there a way that I can access the interfaceOrientation of the View Controller where I am using this CALayer ?
Or I will have to set a property in the custom Layer indicating the current orientation every time it changes ?

A: You could set a property on the custom layer.
Or you could give the custom layer a property that references the view controller so it can just ask the view controller for the interface orientation when the layer needs to know.
Or you could have your view controller post an NSNotification when it rotates, and have the layer observe the notification.

A: UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];

returns UIInterfaceOrientation, current orientation of the application's status bar.

UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation]; returns UIDeviceOrientation, device orientation. But note that UIDeviceOrientation is not always UIInterfaceOrientation. For example, when your device is on a plain table you can receive unexpected value.
