Include in your file (or create a new one) this interface to extend the current UILabel one:
Add the method code in the .m file:@interface UILabel (VerticalAlign)- (void)alignTop;@end
- (void)alignTop {CGSize fontSize = [self.text sizeWithFont:self.font];double finalHeight = fontSize.height * self.numberOfLines;double finalWidth = self.frame.size.width;CGSize theStringSize = [self.text sizeWithFont:self.font constrainedToSize:CGSizeMake(finalWidth, finalHeight) lineBreakMode:self.lineBreakMode];int newLinesToPad =
(finalHeight - theStringSize.height) / fontSize.height;for(int i=0; i self.text = [self.text stringByAppendingString:@"\n "];}
Done, now you can use this new method
[YourUILabel alignTop];
Hope help!