Swift - Set different max length to two input fields inside of one ViewController

class CreateNotViewController: UIViewController {
    @IBOutlet weak private var notifTitle: UITextField!
    @IBOutlet weak private var notifDescribtion: UITextField!
}

extension CreateNotViewController: UITextFieldDelegate {
    func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
        let maxLength: Int 
        switch textfield {
           case notifTitle:
             maxLenght = 15
           case notifDescribtion:
             maxLenght = 10
           default:
             maxLenght = 0
        }
        let currenString: NSString = textField.text! as NSString
        let newString: NSString = currenString.replacingCharacters(in: range, with: string) as NSString

        return newString.length <= maxLength
    }
}

You can check the current textField and change max length

func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool {
    var maxLength = 0
    if textField == notifTitle {
        maxLength = 15
    } else if textField == notifDescribtion {
        maxLength = 25
    }
    let currenString: NSString = textField.text! as NSString
    let newString: NSString = currenString.replacingCharacters(in: range, with: string) as NSString

    return newString.length <= maxLength
}