Ekkogaming
Ekkogaming

Reputation: 42

CGRect has no member 'right'? why CGRect is not working probably?

so am following a guy on youtube who wrote in the CGrect:

nameLabel.frame = CGRect( x: userProfileImage.right + 5,

this code is supposed to put the nameLabel to the right of the userProfileImage but when I use the same code it tells me Value of type 'UIImageView' has no member 'right'

can someone help me figure out why it is not working?

My Code

Youtube tutorial

the black screen is the code of the guy on youtube with no errors, the white is mine. Same Xcode version.

Upvotes: 0

Views: 217

Answers (1)

Alexandra
Alexandra

Reputation: 234

That's because UIView does not have such a member, this guy is probably using an extension or library. Try userProfileImage.frame.maxX.

Upvotes: 3

Related Questions