Displaying Parse Images in UICollectionView Parse.com

为君一笑 提交于 2019-12-13 02:25:04

问题


Im new to ios programming so thank you for your patience. I am creating a collection view with images and labels downloaded from parse.com backend. I am able to display the labels perfectly in the collection view now I am trying to get the corresponding images as well.

I am uncertain how to do so . PLEASE HELP SOS

here is my function

// Get Brands
func getBrand () {

    // Create PFQuery
    var query:PFQuery = PFQuery(className: "BrandInfo")

     // Call findobjects
     query.findObjectsInBackgroundWithBlock {
        (objects:[AnyObject]?, error: NSError?) -> Void in

        // refresh array
        self.brands = [String]()

        // loop through array
        for brandObject in objects! {

        // get PFObjects
        let brandName:String? = (brandObject as! PFObject)["Name"] as? String

            if brandName != nil {
                self.brands.append(brandName!)

             }


        let brandpic:PFFile? = (brandObject as! PFObject)["Image"] as? PFFile

来源:https://stackoverflow.com/questions/31392403/displaying-parse-images-in-uicollectionview-parse-com

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!