From 90b0a9fa5d4008c0511a2550b06234c03cce389a Mon Sep 17 00:00:00 2001 From: KimJisoo Date: Mon, 17 Oct 2022 14:45:08 +0900 Subject: [PATCH] =?UTF-8?q?[ADD]=20-=20#140=20=ED=94=84=EB=A1=9C=ED=95=84?= =?UTF-8?q?=20=EB=B3=80=EA=B2=BD=20Button=20=ED=99=9C=EC=84=B1=ED=99=94=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EditProfileViewController.swift | 36 +++++++++++-------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/Fillin-iOS/Fillin-iOS/Sources/ViewControllers/MyPageViewController/EditProfileViewController.swift b/Fillin-iOS/Fillin-iOS/Sources/ViewControllers/MyPageViewController/EditProfileViewController.swift index 58a07e2..813f35d 100644 --- a/Fillin-iOS/Fillin-iOS/Sources/ViewControllers/MyPageViewController/EditProfileViewController.swift +++ b/Fillin-iOS/Fillin-iOS/Sources/ViewControllers/MyPageViewController/EditProfileViewController.swift @@ -209,9 +209,9 @@ extension EditProfileViewController { func attributePlaceholder() { nicknameTextField.attributedPlaceholder = NSAttributedString(string : "닉네임을 입력해주세요. (10자 이하)", attributes : [NSAttributedString.Key.foregroundColor: UIColor.grey4, - NSAttributedString.Key.font : UIFont.body1]) + NSAttributedString.Key.font : UIFont.body1]) cameraTextField.attributedPlaceholder = NSAttributedString(string : "사용 중인 카메라 이름을 입력해주세요.", - attributes : [NSAttributedString.Key.foregroundColor: UIColor.grey4, + attributes : [NSAttributedString.Key.foregroundColor: UIColor.grey4, NSAttributedString.Key.font :UIFont.body1]) } @objc func profileChangeButtonClicked() { @@ -220,6 +220,10 @@ extension EditProfileViewController { @objc func sendButtonClicked() { print("프로필 변경하기") } + /// 빈 공간 터치하면 키보드 내려가게 + override func touchesBegan(_ touches: Set, with event: UIEvent?) { + self.view.endEditing(true) + } } // MARK: - UITextFieldDelegate @@ -231,7 +235,6 @@ extension EditProfileViewController: UITextFieldDelegate { return true } /// nicknameTextField 글자수 세기, 제한 - /// 빌드해서 Camera TextField 확인하기 @objc private func textDidChange(_ notification: Notification) { if let textField = notification.object as? UITextField { if let nicknametext = nicknameTextField.text { @@ -253,19 +256,22 @@ extension EditProfileViewController: UITextFieldDelegate { clearButton.setImage(Asset.btnClear.image, for: .normal) } } + if nicknametext.isEmpty == true { + self.changeProfileButton.setupButton(title: "프로필 변경", + color: .grey4, + font: .headline, + backgroundColor: .textviewGrey, + state: .normal, + radius: 0) + } else { + self.changeProfileButton.setupButton(title: "프로필 변경", + color: .fillinBlack, + font: .headline, + backgroundColor: .fillinRed, + state: .normal, + radius: 0) + } } -// self.changeProfileButton.setupButton(title: "프로필 변경", -// color: .fillinBlack, -// font: .headline, -// backgroundColor: .fillinRed, -// state: .normal, -// radius: 0) - self.changeProfileButton.setupButton(title: "프로필 변경", - color: .grey4, - font: .headline, - backgroundColor: .textviewGrey, - state: .normal, - radius: 0) } } }