Skip to content

Instantly share code, notes, and snippets.

@haxpor
Created August 28, 2015 15:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haxpor/c6b3eb5dddc5ff8335ca to your computer and use it in GitHub Desktop.
Save haxpor/c6b3eb5dddc5ff8335ca to your computer and use it in GitHub Desktop.
#pragma once
@class UnityView;
@interface UnityViewControllerBase : UIViewController
{
}
- (BOOL)shouldAutorotate;
- (BOOL)prefersStatusBarHidden;
- (UIStatusBarStyle)preferredStatusBarStyle;
@end
// for better handling of user-imposed screen orientation we will have specific ViewController implementations
// view controllers constrained to one orientation
//
@interface UnityPortraitOnlyViewController : UnityViewControllerBase
{
}
- (NSUInteger)supportedInterfaceOrientations;
@end
@interface UnityPortraitUpsideDownOnlyViewController : UnityViewControllerBase
{
}
- (NSUInteger)supportedInterfaceOrientations;
@end
@interface UnityLandscapeLeftOnlyViewController : UnityViewControllerBase
{
}
- (NSUInteger)supportedInterfaceOrientations;
@end
@interface UnityLandscapeRightOnlyViewController : UnityViewControllerBase
{
}
- (NSUInteger)supportedInterfaceOrientations;
@end
// this is default view controller implementation (autorotation enabled)
//
@interface UnityDefaultViewController : UnityViewControllerBase
{
}
- (NSUInteger)supportedInterfaceOrientations;
@end
// this is helper to add proper rotation handling methods depending on ios version
//extern "C" void AddViewControllerRotationHandling(Class class_, IMP willRotateToInterfaceOrientation, IMP didRotateFromInterfaceOrientation, IMP viewWillTransitionToSize);
//extern "C" void AddViewControllerDefaultRotationHandling(Class class_);
// this is helper to add proper rotation handling methods depending on ios version
#ifdef __cplusplus
extern "C" {
#endif
void AddViewControllerRotationHandling(Class class_, IMP willRotateToInterfaceOrientation, IMP didRotateFromInterfaceOrientation, IMP viewWillTransitionToSize);
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
extern "C" {
#endif
void AddViewControllerDefaultRotationHandling(Class class_);
#ifdef __cplusplus
}
#endif
@haxpor
Copy link
Author

haxpor commented Aug 28, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment