I'm trying to update:
https://www.b4x.com/android/forum/t...essentially-portrait-only-app.104006/#content
to work on iOS 16+
I have spent the weekend playing with OBJC - and I know little - and would like to know less - which is what B4i is about.
Experimenting, I have the following embellished OBJC:
is just the original OBJC from the above referenced post - this works as before.
is new code that seems to compile OK - when I get the final step working I will come back and attempt to generalize the "portrait" parameter
This bit has me stumped - I've tried every permutation I can think of.
It is supposed to tell the view controller to update with respect to the "portrait" settings I have made in the prior steps.
Any Objective C help to get this to compile OK would be really appreciated...
https://www.b4x.com/android/forum/t...essentially-portrait-only-app.104006/#content
to work on iOS 16+
I have spent the weekend playing with OBJC - and I know little - and would like to know less - which is what B4i is about.
Experimenting, I have the following embellished OBJC:
Objective-C:
#if OBJC
@end
@interface UIViewController (B4IResize)
@end
@implementation UIViewController (B4IResize)
-(BOOL)shouldAutorotate
{
return [(NSNumber*)[B4IObjectWrapper raiseEvent:self :@"_shouldautorotate" :nil] boolValue];
}
-(UIInterfaceOrientationMask)supportedInterfaceOrientations
{
//https://developer.apple.com/documentation/uikit/uiinterfaceorientationmask/uiinterfaceorientationmaskportrait?language=objc
//return UIInterfaceOrientationMaskPortrait;
return 1;
}
-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
//https://developer.apple.com/documentation/uikit/uiinterfaceorientation/portrait
return 1;
}
//setNeedsUpdateOfSupportedInterfaceOrientations()
#End If
B4X:
-(BOOL)shouldAutorotate
{
return [(NSNumber*)[B4IObjectWrapper raiseEvent:self :@"_shouldautorotate" :nil] boolValue];
}
B4X:
-(UIInterfaceOrientationMask)supportedInterfaceOrientations
{
//https://developer.apple.com/documentation/uikit/uiinterfaceorientationmask/uiinterfaceorientationmaskportrait?language=objc
//return UIInterfaceOrientationMaskPortrait;
return 1;
}
-(UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
//https://developer.apple.com/documentation/uikit/uiinterfaceorientation/portrait
return 1;
}
B4X:
//setNeedsUpdateOfSupportedInterfaceOrientations()
This bit has me stumped - I've tried every permutation I can think of.
It is supposed to tell the view controller to update with respect to the "portrait" settings I have made in the prior steps.
Any Objective C help to get this to compile OK would be really appreciated...