Found the only solution for this problem.
textField.textContentType = .oneTimeCode
Otherwise iOS 12 uses PasswordAutofill for any secure field (textField.isSecureTextEntry = true).
This solution is from apple developer forum Yuri Petukhov’ answer.