Skip to content

Instantly share code, notes, and snippets.

@boolkybear
Created January 28, 2015 09:21
Show Gist options
  • Save boolkybear/abe403570f764409541e to your computer and use it in GitHub Desktop.
Save boolkybear/abe403570f764409541e to your computer and use it in GitHub Desktop.
Multiline UISegmentedControl
extension UISegmentedControl
{
func makeMultiline(numberOfLines: Int)
{
for segment in self.subviews
{
let labels = segment.subviews.filter { $0 is UILabel } // [AnyObject]
labels.map { ($0 as UILabel).numberOfLines = numberOfLines }
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment