UpYun有Swift的示例代码吗?

新手上路,请多包涵
UpYun *uy = [[UpYun alloc] init];
    uy.successBlocker = ^(id data)
    {
        UIAlertView * alert = [[UIAlertView alloc]initWithTitle:@"" message:@"上传成功" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil];
        [alert show];
        NSLog(@"%@",data);
    };
    uy.failBlocker = ^(NSError * error)
    {
        NSString *message = [error.userInfo objectForKey:@"message"];
        UIAlertView * alert = [[UIAlertView alloc]initWithTitle:@"error" message:message delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil];
        [alert show];
        NSLog(@"%@",error);
    };
    uy.progressBlocker = ^(CGFloat percent, long long requestDidSendBytes)
    {
        [_pv setProgress:percent];
    };


    /**
     *  @brief  根据 UIImage 上传
     */
    UIImage * image = [UIImage imageNamed:@"image.jpg"];
    [uy uploadFile:image saveKey:[self getSaveKey]];

如上:)

阅读 2.5k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
logo
又拍云问答
子站问答
访问
宣传栏