Why not using Autolayout, this will also let you support the orientation change on the devices.
var lastLabel:UILabel?
for i in 0..<10servicesLength
{
let label = UILabel()
label.translatesAutoresizingMaskIntoConstraints=false
label.lineBreakMode = .ByWordWrapping
label.numberOfLines = 10
label.font = UIFont(name: label.font.fontName, size: 25)
label.text = servicesList[i]
servicesScroll.addSubview(label)
let metrics=["horizontalMargin":21,"top":0,"bottom":0,"separationBetweenLabels":0,"labelMinHeight":25]
let views=["label":label]
servicesScroll.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("H:|-horizontalMargin-[label]-horizontalMargin-|",
options: NSLayoutFormatOptions(rawValue: 0),
metrics: metrics,
views: views))
if i == 0{
servicesScroll.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:|-top-[label]",
options: NSLayoutFormatOptions(rawValue: 0),
metrics: metrics,
views: views))
}
if let lastLabel=lastLabel{
views["lastLabel"]=lastLabel
servicesScroll.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:[lastLabel]-separationBetweenLabels-[label]",
options: NSLayoutFormatOptions(rawValue: 0),
metrics: metrics,
views: views))
}
if i == (servicesLength-1){
servicesScroll.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:[label]-bottom-|",
options: NSLayoutFormatOptions(rawValue: 0),
metrics: metrics,
views: views))
}
//Optional a minimum height of 25
servicesScroll.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:[label(>=labelMinHeight)]",
options: NSLayoutFormatOptions(rawValue: 0),
metrics: metrics,
views: views))
lastLabel=label
}
The important part is that you set the numberOfLines of each label as the maximum size that you will allow the label to grow.
Also I add a constraint for a miminum height:
//Optional a minimum height of 25
servicesScroll.addConstraints(NSLayoutConstraint.constraintsWithVisualFormat("V:[label(25)]",
options: NSLayoutFormatOptions(rawValue: 0),
metrics: metrics,
views: views))
This will guarantee that the label will be at least 25 height and maximum of 10 lines in this example.