简体   繁体   English

Moltin iOS V2-加载图像很麻烦

[英]Moltin iOS V2 - Loading Images is a pain

I have been trying to work with the Moltin Ecommerce API V2. 我一直在尝试使用Moltin电子商务API V2。 I have looked at the example document, worked through it and nothing works. 我查看了示例文档,对其进行了处理,但没有任何效果。 I came to the point where I started copying the whole document as is... Wait for it... NOTHING WORKS. 我到了开始按原样复制整个文档的地步……等一下……没事。

I took a small example to just load an image using api. 我举了一个小例子,仅使用api加载图像。 Followed the instructions the T but nothing. 遵循指示T,但一无所获。

Is there anyone here that knows what the problem is? 这里有人知道问题出在哪里吗? Secondly - must you use Alamofire for web requests? 其次-您是否必须对Web请求使用Alamofire?

I posted a ticket for this with Moltin. 我和莫尔丁为此签了票。

They have now updated the API call to the following: 他们现在将API调用更新为以下内容:

private func loadProducts() {
let query = MoltinQuery(offset: nil, limit: 20, sort: nil, filter: nil, include: [.main_image])
Moltin.product.list(withQuery: query) { (result) in
    switch result {
    case .failure(let error):
        print("Failed to get products:\n\(error)")
    case .success(let productList):
        print(productList)
        DispatchQueue.main.async {
            self.productsCollectionView.reloadData()
        }
    }
}

} }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM