Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

swift uilabel dynamic height based on text length

let myLabel = UILabel()
// Set leading and trailing constraints, and either top/bottom constraint,
//   likely done within Storyboard
myLabel.numberOfLines = 0
myLabel.sizeToFit()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #swift #uilabel #dynamic #height #based #text #length
ADD COMMENT
Topic
Name
7+7 =