[英]How to use #available / @available in Xamarin.iOS
I need to check for API availability in Xamarin.iOS - in Objective-C or Swift i could use these calls:
if (@available(iOS 13, *))
或者
if #available(iOS 13, *)
什么是available
关键字的Xamarin.iOS
等效项 - 我在 Xamarin ZDB974A63908Z ZDB974238714CAACEDED604 浏览器中找不到任何文档。
The @available mechanism was added to the clang compiler for Objective C with Xcode 9. It is modelled on the Swift #available syntax.And it is unavailable in Xamarin.iOS. 您可以使用以下代码
if (UIDevice.CurrentDevice.CheckSystemVersion(13,0))
{
//...
}
else
{
//...
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.