禁止“部分:在iOS中引入”在部分代码中 [英] Suppressing "is partial: introduced in iOS" in parts of code

查看:69
本文介绍了禁止“部分:在iOS中引入”在部分代码中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序也可用于iOS9 ...

My app is available also for iOS9...

但是在声明时

- (UISwipeActionsConfiguration *)tableView:(UITableView *)tableView trailingSwipeActionsConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath

我在上得到警告是部分的:iOS 11.0 + 中引入的,在这种情况下没有意义,因为该方法不会在iOS11之前调用

i get warnings on is partial: introduced in iOS 11.0+, which doesn't make sence in this case, since the method wont be called prior to iOS11

我想使这段代码的警告保持沉默

i want to silence the warning for this part of code

推荐答案

您可以使用 NS_AVAILABLE_IOS(11_0)将方法标记为指示它仅在iOS 11上可用并取消警告:

You can flag the method with NS_AVAILABLE_IOS(11_0) to indicate that it is only available on iOS 11 and suppress the warnings:

-(UISwipeActionsConfiguration *) tableView:(UITableView *)tableView
   trailingSwipeActionsConfigurationForRowAtIndexPath:(NSIndexPath *)indexPath NS_AVAILABLE_IOS(11_0)

这篇关于禁止“部分:在iOS中引入”在部分代码中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆