How to handle UIResponder.validate for backwards compatibility?

For a project that supports pre iOS13 versions, when overriding validate (_ command: UICommand), the compiler gives the error: 'UICommand' is only available in iOS 13.0 or newer. Putting @available (iOS 13.0, *) before the validate method gives the error: Overriding 'validate' must be as available as declaration it overrides.


How do we get around this?

Replies

Note: The compiler errors occur when building for iOS. Building for MacOS does not give the error.