1

I've tried simply dragging one into my storyboard, but there all I can find is UIImageView. In my IBOutlet for the UIImageView, I changed it to a PFImageView, and I get an error saying: "Use of undeclared type: 'PFImageView'"

Do PFImageViews simply not exist in swift?

  • u need to import parse sdk to use any PFObject , and sometimes u need to add [PFImageView class]; in your delegate – Omarj May 31 '15 at 09:16
  • https://parse.com/questions/using-pfimageview-with-storyboard – Omarj May 31 '15 at 09:17
  • PFImageView is the class present in Parse SDK.You need to cast PFImageview to map it on UIImageView.For that you need to import parse SDK in your project – Talha Q May 31 '15 at 11:42

1 Answers1

6

You need to ensure that you have the Parse SDK installed. You also need to ensure that you import the ParseUI on the class you are using, for example:

import ParseUI

You can then, on your Storyboard, select a normal ImageView, go to the Identity Inspector on your interface builder, change its class from UIImageView to PFImageView

Connect it as an outlet as normal to your code, but instead of connecting as a UIImageView ensure it is a PFImageView, like this:

@IBOutlet weak var imgTestImage :PFImageView!

You now have access to the PFImageView attributes such as:

let theImage = yourObject.valueForKey("profileImage") as? PFFile
imgTestImage.file = theImage
imgTestImage.loadInBackground()

Hope this helps

RJH
  • 358
  • 3
  • 12
  • Except that the error "Unknown class PFImagView in Interface Builder file" persists. – Ryan Bobrowski Sep 20 '15 at 01:18
  • Have you got all of the parse frameworks imported into your project ? Sounds like it's missing one – RJH Sep 20 '15 at 08:19
  • 2
    Slightly tricky, just realized myself that ParseUI is not included with Parse. It's a separate framework you have to import. https://github.com/ParsePlatform/ParseUI-iOS/releases – Jake T. Dec 28 '16 at 00:12