Multiline title button iOS swift

Solution:

The below code is used for set the multiline text to a button in iOS.

iOS 6 and above we can use the below code...

        btn.titleLabel.lineBreakMode = NSLineBreakByWordWrapping;
        btn.titleLabel.textAlignment = NSTextAlignmentCenter; 

Below iOS 6 use the below code:

        btn.titleLabel.lineBreakMode = UILineBreakModeWordWrap;
        btn.titleLabel.textAlignment = UITextAlignmentCenter; 

Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Saved Image in document directory and save path in coredata not able to fetch the image file iOS swift