小编Aja*_*kur的帖子

Alamofire-image 在 uicollectionview 单元格中加载错误的图像

我一直在使用 alamofire-image 库在 uicollectionview 单元格中显示来自 url 的图像。

我注意到大部分时间它显示正确的图像,但有时显示错误的图像(大部分时间是前一个单元格图像)。如何克服这个问题。

      func collectionView(collectionView: UICollectionView,
        cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {

          let cell = collectionView.dequeueReusableCellWithReuseIdentifier("cell",forIndexPath: indexPath) as! myCollectionViewCell

          cell.titleLabelCell.text = element[indexPath.row]["title"]
          cell.generLabelCell.text  = element[indexPath.row]["gener"]

          let URL = NSURL(string: "\(element[indexPath.row]["banner_site_url"])" )!

          cell.mImageView.af_setImageWithURL(URL)

          return cell
      }
Run Code Online (Sandbox Code Playgroud)

alamofire swift2 alamofireimage

5
推荐指数
1
解决办法
895
查看次数

Braintree Paypal Checkout错误:SFSafariViewController不会切换回应用程序

我正在使用Xcode 8,swift 3.通过carthage和braintree版本4.7.2安装.

点击继续沙盒购买按钮它没有回到应用程序并且没有收到响应并且没有收到错误.

在此输入图像描述 在安装过程中我有什么遗漏

我正在按时结账使用PayPal.

              @IBAction func customPayPalButtonPressed(_ sender: AnyObject) {


                    let payPalDriver : BTPayPalDriver = BTPayPalDriver.init(apiClient: self.apiClient!)

                    payPalDriver.viewControllerPresentingDelegate = self
                    payPalDriver.appSwitchDelegate = self

                    let payPalRequest = BTPayPalRequest(amount: "100.00")
                    payPalRequest.currencyCode = "USD"
                    payPalDriver.requestOneTimePayment(payPalRequest) { (tokenizedPayPalAccount, error) -> Void in

                        if (tokenizedPayPalAccount != nil) {

                            print(tokenizedPayPalAccount.debugDescription)
                        }else if (error != nil) {
                            print(error?.localizedDescription)
                            print(error.debugDescription)
                        }else {

                            print("Cancled")

                        }
                    }



                }               
Run Code Online (Sandbox Code Playgroud)

paypal braintree paypal-sandbox ios swift

5
推荐指数
0
解决办法
430
查看次数