【发布时间】:2014-06-03 09:01:45
【问题描述】:
注意:
以下是 Parse 的 CA 对此的一些想法:
https://www.parse.com/questions/ios-when-will-swift-for-parse-be-ready
(请注意这个问题的受欢迎程度 - 热门话题)。希望它可以帮助某人
这是一个 iOS7 Parse 云代码调用...
如何在 SWIFT 中做到这一点?干杯
明确一点...你可以在 SWIFT 中使用“callFunctionInBackground”,还是只需要调用一个 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
}
注意,我注意到这是一个谷歌登录页面,用于试图弄清楚“如何进行云代码调用”(与 Swift 无关)。这是一套完整的适用于 iOS 和 Android 的示例代码自定义云代码功能,在 Parse.com 宇宙中https://stackoverflow.com/a/24010828/294884希望它可以帮助某人
【问题讨论】:
-
稍后 - 完整示例代码 stackoverflow.com/a/24261024/294884
标签: ios parse-platform swift