//
//  Created by Pierluigi Cifani on 12/07/2018.
//

import UIKit

extension UITextField {
    
    static func autolayoutTextFieldWith(textStyle style: UIFont.TextStyle, placeholderText: String) -> UITextField {
        let textField = UITextField()
        textField.translatesAutoresizingMaskIntoConstraints = false
        textField.font = TextStyler.styler.fontForStyle(style)
        textField.setContentHuggingPriority(.required, for: .vertical)
        textField.placeholder = placeholderText
        return textField
    }
}

//
//  Created by Pierluigi Cifani on 12/07/2018.
//

import UIKit

extension UITextField {
    
    static func autolayoutTextFieldWith(textStyle style: UIFont.TextStyle, placeholderText: String) -> UITextField {
        let textField = UITextField()
        textField.translatesAutoresizingMaskIntoConstraints = false
        textField.font = UIFont.preferredFont(forTextStyle: style)
        textField.setContentHuggingPriority(.required, for: .vertical)
        textField.placeholder = placeholderText
        return textField
    }
}

--- 
+++ 
@@ -9,7 +9,7 @@
     static func autolayoutTextFieldWith(textStyle style: UIFont.TextStyle, placeholderText: String) -> UITextField {
         let textField = UITextField()
         textField.translatesAutoresizingMaskIntoConstraints = false
-        textField.font = UIFont.preferredFont(forTextStyle: style)
+        textField.font = TextStyler.styler.fontForStyle(style)
         textField.setContentHuggingPriority(.required, for: .vertical)
         textField.placeholder = placeholderText
         return textField
Make sure the textField is using the right font
