zeus
zeus

Reputation: 13367

How to override a function of an Ios ObjC class?

I have this class :

  UIViewController = interface(UIResponder)
    ['{F7A5E372-3F4A-4F25-A2F9-C91D7CB5FC09}']
    ....
    function supportedInterfaceOrientations: NSUInteger; cdecl;      
    ....  
  end;
  TUIViewController = class(TOCGenericImport<UIViewControllerClass, UIViewController>)  end;

And i need to override the function supportedInterfaceOrientations. Something like this under xcode :

class NavigationController: UIViewController { 

    override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
        return .portrait
    }

}

How to do this under delphi tokyo ?

Upvotes: 0

Views: 105

Answers (1)

In a firemonkey iOS application you don't need to handle that by yourself.

In the project options under Application > Orientation you can enable custom orientation and define all four directions (portrait, upside down, landscape home right, landscape home left) which allows you to configure the same behavior. That is the same as the interface UIInterfaceOrientationMask offers.

Upvotes: 0

Related Questions