passforios/passKit/Extensions/UIViewControllerExtension.swift

20 lines
457 B
Swift
Raw Permalink Normal View History

//
// UIViewControllerExtension.swift
2021-08-28 07:32:31 +02:00
// passKit
//
// 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
}
}