I am trying to save images from Parse to a list. Now I am saving the images as PFFileObject, but I want to save them as uiimages instead. I am using this code:
var weblinks = [String]()
var webnames = [String]()
var webobjects= [PFFileObject]()
var webimages = [UIImage]()
func fetchFromParse() {
let query = PFQuery(className:"FirstClass")
query.findObjectsInBackground { (objects, error) -> Void in
if error == nil {
for object in objects! {
self.webnames.append(object["webnames"]! as! String)
self.weblinks.append(object["weblinks"]! as! String)
self.webimages.append(object["webobjects"]! as! PFFileObject
}
self.myCollectionView.reloadData()
} else {
print(error!)
}
}
}
How can I do to save the images to webimages instead of webobjects?