Как это сделать в SWIFT?
Чтобы внести ясность... можете ли вы использовать «callFunctionInBackground» в SWIFT или вам нужно просто вызвать класс objc?
Код: Выделить всё
-(void)tableView:(UITableView *)tableView
commitEditingStyle:(UITableViewCellEditingStyle)editingStyle
forRowAtIndexPath:(NSIndexPath *)indexPath
{
int thisRow = indexPath.row;
PFUser *delFriend = [self.theFriends objectAtIndex:thisRow];
NSLog(@"you wish to delete .. %@", [delFriend fullName] );
// note, this cloud call is happily is set and forget
// there's no return either way. life's like that sometimes
[PFCloud callFunctionInBackground:@"clientRequestFriendRemove"
withParameters:@{
@"removeThisFriendId":delFriend.objectId
}
block:^(NSString *serverResult, NSError *error)
{
if (!error)
{
NSLog(@"ok, Return (string) %@", serverResult);
}
}];
[self back]; // that simple
}
Вот некоторые мысли по этому поводу из CA в Parse:
https://www.parse.com/questions/ios-whe ... e-be-ready
(Обратите внимание, насколько популярен этот вопрос — горячая тема).
Обновление
Обратите внимание: я заметил, что это целевая страница Google, где пытаются выяснить, «как, черт возьми, выполнять вызовы облачного кода» (не имеет отношения к Swift). Вот полный набор примеров кода для iOS и Android пользовательских функций облачного кода во вселенной Parse.com https://stackoverflow.com/a/24010828/294884
Подробнее здесь: https://stackoverflow.com/questions/240 ... -code-call
Мобильная версия