I've been wondering, is there a nice way to make `UIButtons` with multi-line `titleLabel` in Interface Builder? I've found none and puttin a separate `UILabel` on top of each button and tracking it's color on press and other events is not very straightforward. 

Maybe there are better alternatives done in code if there's no such way in IB?
['https://Stackoverflow.com/questions/18659832', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1313939/']
**Code:**

To allow multiple line you can use:

```
button.titleLabel.lineBreakMode = UILineBreakModeWordWrap;
button.titleLabel.textAlignment = UITextAlignmentCenter;
[button setTitle: @"Line1\nLine2" forState: UIControlStateNormal];

```

In **iOS 6**, `UILineBreakModeWordWrap` and `UITextAlignmentCenter` are deprecated, so use:

```
button.titleLabel.lineBreakMode = NSLineBreakByWordWrapping;
button.titleLabel.textAlignment = NSTextAlignmentCenter;

```

**Interface Builder:**

* In interface builder select *UIButton*
* on the right side Utilities pane under *Attributes Inspector*, you'll see an option for *Line Break*
* Choose *Word Wrap*
Just to mention if one does not want word wrap but still want to achieve multi line title on a UIButton it can be done by setting lineBreakMode before numberOfLines,
This is because lineBreakMode seems to cancel out numberOfLines set hence we are doing it in this order.

Swift:

> 
> button.titleLabel?.lineBreakMode = NSLineBreakMode.byTruncatingTail
> 
> 
> button.titleLabel?.numberOfLines = 2
> 
> 
> button.setTitle(myTitle, for: UIControlState.normal)
> 
> 
>