robertsan
robertsan

Reputation: 1621

Trying to use setNeedsDisplay()

I'm trying to reload the UIView. Actually I get an error

Cannot convert value of type 'HomeViewController' to expected argument type 'UIView'

So this is the code:

UIView.setNeedsDisplay(self)

Do you have any idea?

Upvotes: 0

Views: 4235

Answers (1)

Hamish
Hamish

Reputation: 80801

UIView is a class, and setNeedsDisplay() is an instance function.

You want to be calling this function on the UIView instance (not the class itself). So you want:

self.view.setNeedsDisplay();

setNeedsDisplay() also doesn't take any arguments, so I don't know why you were trying to pass self into it.

Upvotes: 5

Related Questions