How do I make a UIButton wrap lines in the Title?  Here is a sample code:

   func testing() {

        let aButton = UIButton(type: .system)

        aButton.lineWrap = true  //How do I make aButton wrap lines?

        aButton.setTitle("123\n456\n789", for: .normal)

        self.view.addSubview(aButton)

    }


What I want to see is a button like this:

 ---

|123|

|456|

|789|

 ---


This can be done in the Storyboard by selecting "Word Wrap" in the Button's 
Control - Line Break attribute.  But I am creating my UIButtons in code and can 
not find the proper syntax to code this.


Thomas Cavalli
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users

Reply via email to