I want to make item and font sizes looking same as screen sizes. I used to use item ratio for scaling to handle different iOS screen but there was problem with item\'s size
Try this code :-
struct fontSizeConstant{
static let relativeFontConstant : CGFloat = 0.015
static let bigFontConst : CGFloat = 0.050
static let lessBigFontConst : CGFloat = 0.040
static let mediumFontConst : CGFloat = 0.030
}
userName.font = userName.font?.withSize(self.view.frame.height * fontSizeConstant.mediumFontConst)
password.font = password.font?.withSize(self.view.frame.height * fontSizeConstant.mediumFontConst)
loginButton.titleLabel?.font = loginButton.titleLabel?.font.withSize(self.view.frame.height * fontSizeConstant.lessBigFontConst)