简体   繁体   中英

Will IOS private API affect the app publishing on App Store?

I have used the titleForSwipeAccessoryButtonForRowAtIndexPath , swipeAccessoryButtonPushedForRowAtIndexPath (For IOS 7) and editActionsForRowAtIndexPath (For IOS 8) on my app.

The purpose that I add these two APIs which is for using the swipe to show the delete button which is for delete the items of the row and share button which is for sharing the contents of the row on facebook, whatsapp, twitter etc. And my client need these functions.

The titleForSwipeAccessoryButtonForRowAtIndexPath and swipeAccessoryButtonPushedForRowAtIndexPath are private APIs. Will my App be rejected by Apple when I publish my App on App Store?

You need not to worry about the app rejection from the apple if you are using this private API's. But make sure that the app doesn't crash while using this API's. Also, if you are targeting this app for iOS 8.0 or higher, you can achieve this by implementing following method. After this you do not have to worry about any rejection.

    -(NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewRowAction *button = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDefault title:@"Delete" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {
     //do whatever you want to do...
}

It is easy to implement and you can add as many buttons as you want to add. Also, implement below delegate method for this code to work.

-(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath

Cheers..!!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM