         return token;
         }
         }];
-        
-        
-        OSSClientConfiguration * conf = [OSSClientConfiguration new];
-        conf.maxRetryCount = 3;
-        conf.enableBackgroundTransmitService = NO; // 是否开启后台传输服务
-        conf.timeoutIntervalForRequest = 15;
-        conf.timeoutIntervalForResource = 24 * 60 * 60;
-        
-        ossClient = [[OSSClient alloc] initWithEndpoint:endPoint credentialProvider:credential clientConfiguration:conf];
-*/
+        */
+        
+        let conf = OSSClientConfiguration()
+        conf.maxRetryCount = 3
+        conf.enableBackgroundTransmitService = false // 是否开启后台传输服务
+        conf.timeoutIntervalForRequest = 15
+        conf.timeoutIntervalForResource = 24 * 60 * 60
+        ossClient = OSSClient(endpoint: endPoint, credentialProvider: credential, clientConfiguration: conf)
     }
 }
 

        let credential = OSSPlainTextAKSKPairCredentialProvider(plainTextAccessKey: AccessKey, secretKey:SecretKey)
    
        // 自实现签名，可以用本地签名也可以远程加签
//        id<OSSCredentialProvider> credential1 = [[OSSCustomSignerCredentialProvider alloc] initWithImplementedSigner:^NSString *(NSString *contentToSign, NSError *__autoreleasing *error) {
//        NSString *signature = [OSSUtil calBase64Sha1WithData:contentToSign withSecret:@"3YpqwaeHIWQlIJQk"];
//        if (signature != nil) {
//        *error = nil;
//        } else {
//        // construct error object
//        *error = [NSError errorWithDomain:@"<your error domain>" code:OSSClientErrorCodeSignFailed userInfo:nil];
//        return nil;
//        }
//        return [NSString stringWithFormat:@"OSS %@:%@", @"z9Pq9bnY6pzKzGnoS3DEz8END8lwwm", signature];
//        }];
        
        /*
        

                print("upload object success!");
            }
        }
    }
}

