You’re right. I found this very confusing at first, but I think I can understand why. The docs say the rect parameter is “A rectangle specified in the local coordinate system (bounds) of the receiver.”

So I think the convert method is subtracting bounds.origin from the origin of the rectangle you pass in rect. If you pass bounds for rect then it doesn’t matter what bounds.origin is, it will be cancelled out!

Written by

Independent and freelance software developer for iPhone, iPad and Mac

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store