Search code examples
iosobjective-ccocoaxcode8

Suppressing "is partial: introduced in iOS" in parts of code


My app is available also for iOS9...

when declaring however

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

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

enter image description here


Solution

  • 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)