I need to set constraints on the title text of my application such that the font size of the text is relative to that of the superview. This would help the text to vary with the screen size.
CodePudding user response:
Found how to do so.
So what I did was:
- I linked and made a variable for my title text by:
@IBOutlet weak var iXyloTitle: UILabel!
- then what I did was, set the size of the title text relative to the superview ie: 0.031 to the size of the superview by:
iXyloTitle.font = iXyloTitle.font.withSize(self.view.frame.height * 0.031)