How to suppress obsolescence warning in Swift (1.2) code?

I have this simple Swift property:

private var isPortraitOrientation: Bool { return UIInterfaceOrientationIsPortrait(interfaceOrientation) } 

Xcode shows me the warning 'Interface orientation' was deprecated in iOS version 8.0 . However, the proposed replacement viewWillTransitionToSize does not work in a custom keyboard extension. So I have to use an outdated API ... Can I at least suppress these warnings, so I don’t see them every time I compile?

+6
source share
1 answer
  private var isPortraitOrientation: Bool { return UIDevice.currentDevice().orientation == UIDeviceOrientation.Portrait } 
-4
source

Source: https://habr.com/ru/post/986083/


All Articles