Regis St-Gelais's extension answer for Swift 3 and Swift 4 and without forced unwrapping:. iOS has some big chunky titles, like “Inbox” below – at 34pt, it’s about the biggest text you’ll see on an iPhone. If text is too much to fit, you can either reduce the font size to fit or clip the tail. I also tried changing it to .Right but it still stays centered. In this function pass string that you want to assign in label and pass font size in place of self.activityFont and pass label width in place of 235, now you get label height according to your string. uilabel font size swift . See Auto Layout Guide. SWIFT 3 - 커스텀 뷰 만들기 (Custom uiview with xib) (5) 2016.11.02: SWIFT 3 - 포스터치 사용하기 (Force Touch,UIPreviewInteraction) (0) 2016.10.30: SWIFT 3 - UILabel 글자 크기 부분 변경(Changing font size inside label) (0) 2016.10.30: SWIFT 3 - URL에서 이미지 가져오기(Download image from … You can set the font to automatically fill the size of a label, and optionally not go below a minimum font size. ... UILabel과 다르게 font 픽셀이 깨져보여서 마음에 들지 않는다. Swift 3 Update: Set a default font for whole iOS app?, [[UILabel appearance] setFont:[UIFont fontWithName:@"YourFontName" size:​17.0]]; (https://stackoverflow.com/a/23042694/2082851), I make my own swift 4. How to create UILabel programmatically in swift 4 and make it , You can create a label programmatically using the UILabel class and set various properties such as text color, style, font size, etc. The Swift 4.1 extension method to calculate label height: Create Extension to calculate the height of label following method return height of the label, Use this method to get determine the size for you string. It runs a binary search algorithm to resize the font based off the width and height of the label's bounds. 20 can be whatever size you want of course. USAGE: Where