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
又拍云问答
子站问答
访问
宣传栏