Find number of lines for UILabel – Swift Tutorial

In iOS app development, there are times when it’s necessary to determine the number of lines displayed by a UILabel. This helps in making adjustments to the app’s user interface based on the number of lines the UILabel occupies. In this tutorial, we’ll provide a code snippet that calculates the number of lines in a UILabel.

Code snippet to calculating number of lines for UILabel

Swift

How to use UILabel extension to find number of lines for UILabel

Swift