passforios/passKit/Extensions/UIViewControllerExtension.swift

20 lines
454 B
Swift
Raw Normal View History

//
// UIViewControllerExtension.swift
// pass
//
// Created by Yishi Lin on 5/4/17.
// Copyright © 2017 Yishi Lin. All rights reserved.
//
2020-11-07 12:06:28 +01:00
public extension UIViewController {
@objc
2020-11-07 12:06:28 +01:00
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
if textField.nextField != nil {
textField.nextField?.becomeFirstResponder()
} else {
textField.resignFirstResponder()
}
return true
}
}