File tree 2 files changed +16
-2
lines changed
ViewController/Generate3D
2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ class Generate3DView {
89
89
tf_search. textColor = . textGray
90
90
tf_search. font = . suit( size: 14 , weight: . w500)
91
91
tf_search. addSubview ( btn_search)
92
- tf_search. returnKeyType = . done
92
+ tf_search. returnKeyType = . search
93
93
btn_search. becomeFirstResponder ( )
94
94
95
95
btn_search. snp. makeConstraints { make in
Original file line number Diff line number Diff line change 7
7
8
8
import UIKit
9
9
import RxCocoa
10
+ import Toast_Swift
10
11
11
12
class Generate3DTabController : UIViewController {
12
13
let generate3DView = Generate3DView ( )
@@ -39,7 +40,7 @@ class Generate3DTabController: UIViewController {
39
40
// MARK: - Event Delegate
40
41
extension Generate3DTabController : UITextFieldDelegate {
41
42
@objc func didTapSearchBtn( _ sender: UIButton ) {
42
- print ( " search " )
43
+ self . searchAndPresent ( )
43
44
}
44
45
45
46
@objc func didTapCameraBtn( _ sender: UIButton ) {
@@ -54,4 +55,17 @@ extension Generate3DTabController: UITextFieldDelegate {
54
55
textField. resignFirstResponder ( )
55
56
return true
56
57
}
58
+
59
+ func textFieldDidEndEditing( _ textField: UITextField ) {
60
+ self . searchAndPresent ( )
61
+ }
62
+
63
+ private func searchAndPresent( ) {
64
+ guard self . generate3DView. tf_search. hasText, let keyword = self . generate3DView. tf_search. text else {
65
+ self . view. makeToast ( " 키워드를 입력해주세요 " , duration: 2 , position: . center)
66
+ return
67
+ }
68
+
69
+ self . navigationController? . pushViewController ( EditTextViewController ( key: keyword) , animated: true )
70
+ }
57
71
}
You can’t perform that action at this time.
0 commit comments