Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a shortcut for (self.frame.origin.y + self.frame.size.height)?

I write too much of this code :

self.frame.origin.y + self.frame.size.height 

Is there shortcut for this? Something like self.frame.y_plus_height?

If there is, I'm not sure if that good news or bad news for all the times I wrote the full sentence.

like image 517
user1105951 Avatar asked Dec 06 '22 06:12

user1105951


1 Answers

This should do the trick:

CGFloat res = CGRectGetMaxY(self.frame);

Documentation can be found here.

EDIT: according to explanation from rob mayoff (see comments) this is a little more expensive than simply summing origin.y + size.height in code.

like image 125
Rok Jarc Avatar answered Dec 10 '22 11:12

Rok Jarc