Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[self.titleLabel sizeToFit];
CGFloat titleLabelWidth = CGRectGetWidth(self.titleLabel.frame) + margin * 2; // margin from both sides.
CGFloat imageViewWidth = CGRectGetWidth(self.imageView.frame) + margin * 2; // margin from both sides.
CGFloat height = CGRectGetHeight(self.imageView.frame) + CGRectGetHeight(self.titleLabel.frame) + margin * 3; // margin from top and bottom and distance between `imageView` and `titleLabel`.
return CGSizeMake(MAX(titleLabelWidth, imageViewWidth), height);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment