gpt4 book ai didi

objective-c - 将 Objective-C 转换为 Swift 以模拟 S3

转载 作者:行者123 更新时间:2023-11-28 13:25:06 26 4
gpt4 key购买 nike

我想模拟 S3,但我似乎无法想出以下 Swift 等价物:

- (void)listObjects:(AWSS3ListObjectsRequest *)request completionHandler:(void (^ _Nullable)(AWSS3ListObjectsOutput * _Nullable response, NSError * _Nullable error))completionHandler;

我已经尝试了很多选择:

//    func listObjects(request: AWSS3ListObjectsRequest) -> AWSTask<AWSS3ListObjectsOutput>
// func listObjects(request: AWSS3ListObjectsRequest, completionHandler: (AWSTask<AWSS3ListObjectsOutput>) -> AnyObject?)
func listObjects(request: AWSS3ListObjectsRequest, completionHandler: () -> AWSTask<AWSS3ListObjectsOutput>)
// - (void)listObjects:(AWSS3ListObjectsRequest *)request completionHandler:(void (^ _Nullable)(AWSS3ListObjectsOutput * _Nullable response, NSError * _Nullable error))completionHandler;

但我似乎无法获得 AWSS3 符合的。我需要这样做来模拟 Swift 中的函数。

最佳答案

func listObjects(request: AWSS3ListObjectsRequest, completionHandler: ((AWSS3ListObjectsOutput?, Error?) -> Void)?) {

}

关于objective-c - 将 Objective-C 转换为 Swift 以模拟 S3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58500377/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com