From 0c2090dc3924253e9ee3cce3bae670e9ad646a14 Mon Sep 17 00:00:00 2001 From: seu11ee Date: Mon, 9 Nov 2020 22:14:10 +0900 Subject: [PATCH 1/5] =?UTF-8?q?=EB=B9=84=EB=B2=88=EB=B3=80=EA=B2=BD,=20?= =?UTF-8?q?=ED=83=88=ED=87=B4,=20=EB=A1=9C=EA=B7=B8=EC=95=84=EC=9B=83?= =?UTF-8?q?=EC=8B=9C=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=EB=B7=B0=EB=A1=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Mongle/Mongle/Source/VCs/AccountEditVC.swift | 13 ++--- Mongle/Mongle/Source/VCs/MyTabVC.swift | 4 +- .../Mongle/Source/VCs/PasswordChangeVC.swift | 49 ++++++++++++------- 3 files changed, 42 insertions(+), 24 deletions(-) diff --git a/Mongle/Mongle/Source/VCs/AccountEditVC.swift b/Mongle/Mongle/Source/VCs/AccountEditVC.swift index f7c6481..e7de730 100644 --- a/Mongle/Mongle/Source/VCs/AccountEditVC.swift +++ b/Mongle/Mongle/Source/VCs/AccountEditVC.swift @@ -142,12 +142,13 @@ class AccountEditVC: UIViewController { callWithdraw() //탈퇴 API } - let root = self.navigationController?.viewControllers.first - let pvc = root!.presentingViewController as? LogInVC - - pvc?.idTextField.text = "" - pvc?.passwordTextField.text = "" - self.view.window?.rootViewController?.dismiss(animated: true, completion: nil) + guard let loginVC = UIStoryboard(name:"LogIn", bundle:nil).instantiateViewController(identifier: "LogInVC") as? LogInVC else{ + return + } + loginVC.modalPresentationStyle = .fullScreen + self.present(loginVC,animated: true){ + self.navigationController?.popToRootViewController(animated: false) + } } @objc func noButtonAction(){ diff --git a/Mongle/Mongle/Source/VCs/MyTabVC.swift b/Mongle/Mongle/Source/VCs/MyTabVC.swift index 8deb785..d47a980 100644 --- a/Mongle/Mongle/Source/VCs/MyTabVC.swift +++ b/Mongle/Mongle/Source/VCs/MyTabVC.swift @@ -99,7 +99,7 @@ class MyTabVC: UIViewController { //MARK:- LifeCycle Methods override func viewDidLoad() { super.viewDidLoad() - + setMenu() } override func viewWillDisappear(_ animated: Bool) { observingList.forEach { $0.invalidate() } @@ -253,6 +253,8 @@ class MyTabVC: UIViewController { print("내 프로필 테마: \(data)") DispatchQueue.main.async { self.themeMenuLabel.text = "\(self.themeNum)" + print("왜안바뀜") + self.pageInstance?.setViewControllers([(self.pageInstance?.vcArr![0])!], direction: .forward, animated: false, completion: nil) } diff --git a/Mongle/Mongle/Source/VCs/PasswordChangeVC.swift b/Mongle/Mongle/Source/VCs/PasswordChangeVC.swift index 4055220..29d1492 100644 --- a/Mongle/Mongle/Source/VCs/PasswordChangeVC.swift +++ b/Mongle/Mongle/Source/VCs/PasswordChangeVC.swift @@ -190,16 +190,16 @@ class PasswordChangeVC: UIViewController { func registerForKeyboardNotifications() { NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow(_:)), name: - UIResponder.keyboardWillShowNotification, object: nil) + UIResponder.keyboardWillShowNotification, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide(_:)), name: - UIResponder.keyboardWillHideNotification, object: nil) + UIResponder.keyboardWillHideNotification, object: nil) } func unregisterForKeyboardNotifications() { NotificationCenter.default.removeObserver(self, name: - UIResponder.keyboardWillShowNotification, object: nil) + UIResponder.keyboardWillShowNotification, object: nil) NotificationCenter.default.removeObserver(self, name: - UIResponder.keyboardWillHideNotification, object: nil) + UIResponder.keyboardWillHideNotification, object: nil) } func showPopupView(_ popupTitle: String, _ popupText: String){ @@ -253,7 +253,7 @@ class PasswordChangeVC: UIViewController { @objc func keyboardWillShow(_ notification: NSNotification) { if let keyboardSize = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] - as? NSValue)?.cgRectValue { + as? NSValue)?.cgRectValue { UIView.animate(withDuration: 0.3, animations: { self.completeButtonBottomConstraint.constant = keyboardSize.height+16 }) @@ -262,25 +262,30 @@ class PasswordChangeVC: UIViewController { @objc func keyboardWillHide(_ notification: NSNotification) { guard let duration = notification.userInfo?[UIResponder.keyboardAnimationDurationUserInfoKey] - as? Double else {return} + as? Double else {return} guard let curve = notification.userInfo?[UIResponder.keyboardAnimationCurveUserInfoKey] - as? UInt else {return} - + as? UInt else {return} + UIView.animate(withDuration: duration, delay: 0.0, options: .init(rawValue: curve), animations: { self.completeButtonBottomConstraint.constant = 50 self.view.layoutIfNeeded() - }) + }) } @objc func yesButtonAction(){ - self.popupImageView.removeFromSuperview() - self.blurImageView.removeFromSuperview() - let root = self.navigationController?.viewControllers.first - let pvc = root!.presentingViewController as? LogInVC - - pvc?.idTextField.text = "" - pvc?.passwordTextField.text = "" - self.view.window?.rootViewController?.dismiss(animated: true, completion: nil) + guard let loginVC = UIStoryboard(name:"LogIn", bundle:nil).instantiateViewController(identifier: "LogInVC") as? LogInVC else{ + return + } + loginVC.modalPresentationStyle = .fullScreen + self.present(loginVC,animated: true){ + self.navigationController?.popToRootViewController(animated: false) + } +// self.navigationController?.popToRootViewController(animated: false){ +// guard let loginVC = UIStoryboard(name:"LogIn", bundle:nil).instantiateViewController(identifier: "LogInVC") as? LogInVC else{ +// return +// } +// self.view.window?.rootViewController?.present(loginVC,animated:true,completion:nil) +// } } // MARK: - IBActions @@ -420,3 +425,13 @@ extension PasswordChangeVC: UITextFieldDelegate{ enum WarningState{ case rule, match,empty } + +extension UINavigationController{ + func popToRootViewController(animated: Bool = true, completion: @escaping () -> Void) { + CATransaction.begin() + CATransaction.setCompletionBlock(completion) + popToRootViewController(animated: animated) + CATransaction.commit() + } +} + From bdb0925b265daa3439fab6f359f36411961688f4 Mon Sep 17 00:00:00 2001 From: seu11ee Date: Mon, 9 Nov 2020 23:45:27 +0900 Subject: [PATCH 2/5] =?UTF-8?q?=ED=94=84=EB=A1=9C=ED=95=84=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=EB=B7=B0=20post=20=EC=A0=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../APIService/MyProfileService.swift | 2 +- .../Source/Cell/ProfileEditIntroduceTVC.swift | 1 + .../Mongle/Source/Model/MyProfileData.swift | 2 +- Mongle/Mongle/Source/VCs/AccountEditVC.swift | 5 ++-- Mongle/Mongle/Source/VCs/MyTabVC.swift | 26 ++++++++++++++----- .../Mongle/Source/VCs/PasswordChangeVC.swift | 7 +---- Mongle/Mongle/Source/VCs/ProfileEditVC.swift | 8 +++++- 7 files changed, 33 insertions(+), 18 deletions(-) diff --git a/Mongle/Mongle/Resource/APIService/MyProfileService.swift b/Mongle/Mongle/Resource/APIService/MyProfileService.swift index d0cd816..fd21501 100644 --- a/Mongle/Mongle/Resource/APIService/MyProfileService.swift +++ b/Mongle/Mongle/Resource/APIService/MyProfileService.swift @@ -68,7 +68,7 @@ struct MyProfileService { guard let data = decodedData.data else{ - return .requestErr(decodedData.message) + return .requestErr("디코딩실패") } return .success(data) diff --git a/Mongle/Mongle/Source/Cell/ProfileEditIntroduceTVC.swift b/Mongle/Mongle/Source/Cell/ProfileEditIntroduceTVC.swift index 577f1e8..3b01337 100644 --- a/Mongle/Mongle/Source/Cell/ProfileEditIntroduceTVC.swift +++ b/Mongle/Mongle/Source/Cell/ProfileEditIntroduceTVC.swift @@ -23,6 +23,7 @@ class ProfileEditIntroduceTVC: UITableViewCell { override func awakeFromNib() { super.awakeFromNib() introduceTextField.delegate = self + introduceTextField.text = MyProfileClass.shared.introduce ?? "" introduceTextField.addLeftPadding(left: 15) introduceTextField.makeRounded(cornerRadius: 10) introduceTextField.setBorder(borderColor: .veryLightPinkFive, borderWidth: 1) diff --git a/Mongle/Mongle/Source/Model/MyProfileData.swift b/Mongle/Mongle/Source/Model/MyProfileData.swift index 20605ea..2562c98 100644 --- a/Mongle/Mongle/Source/Model/MyProfileData.swift +++ b/Mongle/Mongle/Source/Model/MyProfileData.swift @@ -12,7 +12,7 @@ import Foundation struct MyProfileData: Codable { var curatorIdx: Int var name: String - var img: String + var img: String? var introduce: String? var keywordIdx: Int? var subscribe: Int diff --git a/Mongle/Mongle/Source/VCs/AccountEditVC.swift b/Mongle/Mongle/Source/VCs/AccountEditVC.swift index e7de730..5e53dc6 100644 --- a/Mongle/Mongle/Source/VCs/AccountEditVC.swift +++ b/Mongle/Mongle/Source/VCs/AccountEditVC.swift @@ -67,7 +67,6 @@ class AccountEditVC: UIViewController { super.viewDidLoad() accountEditTableView.delegate = self accountEditTableView.dataSource = self - print(UIScreen.main.bounds.height) } @@ -142,6 +141,7 @@ class AccountEditVC: UIViewController { callWithdraw() //탈퇴 API } + UserDefaults.standard.removeObject(forKey: "token") guard let loginVC = UIStoryboard(name:"LogIn", bundle:nil).instantiateViewController(identifier: "LogInVC") as? LogInVC else{ return } @@ -175,7 +175,7 @@ extension AccountEditVC: UITableViewDelegate{ guard let nextVC = UIStoryboard(name: "PasswordChange",bundle: nil).instantiateViewController(identifier: "PasswordChangeVC") as? PasswordChangeVC else{ return } - print(1) + self.navigationController?.pushViewController(nextVC, animated: true) //로그아웃 case 1: @@ -205,7 +205,6 @@ extension AccountEditVC: UITableViewDataSource{ guard let cell = tableView.dequeueReusableCell(withIdentifier: AccountEditTVC.identifier) as? AccountEditTVC else{ return UITableViewCell() } - print(1) cell.accountEditMenuLabel.text = accountEditMenu[indexPath.row] return cell diff --git a/Mongle/Mongle/Source/VCs/MyTabVC.swift b/Mongle/Mongle/Source/VCs/MyTabVC.swift index d47a980..a08a07d 100644 --- a/Mongle/Mongle/Source/VCs/MyTabVC.swift +++ b/Mongle/Mongle/Source/VCs/MyTabVC.swift @@ -170,7 +170,7 @@ class MyTabVC: UIViewController { } self.myProfileData = data[0] - self.profileImg = self.myProfileData!.img + self.profileImg = self.myProfileData!.img ?? "mongles" self.profileName = self.myProfileData!.name self.profileKeywordIdx = self.myProfileData!.keywordIdx @@ -194,7 +194,12 @@ class MyTabVC: UIViewController { } - print("내 프로필: \(data)") + MyProfileClass.shared.curatorIdx = self.myProfileData!.curatorIdx + MyProfileClass.shared.image = self.myProfileData?.img + MyProfileClass.shared.introduce = self.myProfileData?.introduce + MyProfileClass.shared.keywordIdx = self.myProfileData?.keywordIdx + MyProfileClass.shared.name = self.myProfileData!.name + MyProfileClass.shared.subscribe = self.myProfileData!.subscribe DispatchQueue.main.async { self.setMenu() self.setProfile() @@ -248,12 +253,9 @@ class MyTabVC: UIViewController { guard let data = theme as? MyThemeData else { return } - print("성공") self.themeNum = data.save.count + data.write.count - print("내 프로필 테마: \(data)") DispatchQueue.main.async { self.themeMenuLabel.text = "\(self.themeNum)" - print("왜안바뀜") self.pageInstance?.setViewControllers([(self.pageInstance?.vcArr![0])!], direction: .forward, animated: false, completion: nil) } @@ -282,7 +284,6 @@ class MyTabVC: UIViewController { return } self.sentenceNum = data.save.count + data.write.count - print("내 프로필 테마: \(data)") DispatchQueue.main.async { self.sentenceMenuLabel.text = "\(self.sentenceNum)" } @@ -337,3 +338,16 @@ class MyTabVC: UIViewController { } + +class MyProfileClass{ + static let shared = MyProfileClass() + + private init(){} + + var curatorIdx: Int = 0 + var name: String = "" + var image: String? + var introduce: String? + var keywordIdx: Int? + var subscribe: Int = 0 +} diff --git a/Mongle/Mongle/Source/VCs/PasswordChangeVC.swift b/Mongle/Mongle/Source/VCs/PasswordChangeVC.swift index 29d1492..9d766d4 100644 --- a/Mongle/Mongle/Source/VCs/PasswordChangeVC.swift +++ b/Mongle/Mongle/Source/VCs/PasswordChangeVC.swift @@ -280,12 +280,7 @@ class PasswordChangeVC: UIViewController { self.present(loginVC,animated: true){ self.navigationController?.popToRootViewController(animated: false) } -// self.navigationController?.popToRootViewController(animated: false){ -// guard let loginVC = UIStoryboard(name:"LogIn", bundle:nil).instantiateViewController(identifier: "LogInVC") as? LogInVC else{ -// return -// } -// self.view.window?.rootViewController?.present(loginVC,animated:true,completion:nil) -// } + } // MARK: - IBActions diff --git a/Mongle/Mongle/Source/VCs/ProfileEditVC.swift b/Mongle/Mongle/Source/VCs/ProfileEditVC.swift index 9c7c544..f5815f3 100644 --- a/Mongle/Mongle/Source/VCs/ProfileEditVC.swift +++ b/Mongle/Mongle/Source/VCs/ProfileEditVC.swift @@ -52,10 +52,10 @@ class ProfileEditVC: UIViewController { override func viewDidLoad() { super.viewDidLoad() setLayout() - setKeywordButton() updateSelectedKeywordButton() setGesture() + setData() // Do any additional setup after loading the view. } @@ -162,6 +162,12 @@ class ProfileEditVC: UIViewController { } } } + func setData(){ + self.nickNameTextField.text = MyProfileClass.shared.name + self.profileImageView.image = UIImage(named:MyProfileClass.shared.image ?? "mySettingsProfile4ImgProfile") + self.keywordButton[MyProfileClass.shared.keywordIdx ?? 0].tag = MyProfileClass.shared.keywordIdx ?? 0 + updateSelectedKeywordButton() + } func testValidInput(){ keywordLabelTopConstraint.constant = 59 if isValidNickNameInput() { From d03d0add8a58002880835c592ce6bfd68c90c4d0 Mon Sep 17 00:00:00 2001 From: seu11ee Date: Wed, 11 Nov 2020 23:51:42 +0900 Subject: [PATCH 3/5] =?UTF-8?q?=ED=94=84=EB=A1=9C=ED=95=84=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20api=20=EC=9A=94=EC=B2=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Mongle/Mongle.xcodeproj/project.pbxproj | 7 +- .../APIService/MyProfileService.swift | 117 +++++++++++++----- .../Contents.json | 23 ++++ .../mySettingsProfilePopupBg.png | Bin 0 -> 7022 bytes .../mySettingsProfilePopupBg@2x.png | Bin 0 -> 25055 bytes .../mySettingsProfilePopupBg@3x.png | Bin 0 -> 53135 bytes .../Contents.json | 23 ++++ .../mySettingsProfilePopupBox.png | Bin 0 -> 4934 bytes .../mySettingsProfilePopupBox@2x.png | Bin 0 -> 12944 bytes .../mySettingsProfilePopupBox@3x.png | Bin 0 -> 20615 bytes .../Source/Cell/ProfileEditIntroduceTVC.swift | 8 +- .../Source/Model/MyProfileUploadData.swift | 17 +++ Mongle/Mongle/Source/VCs/MySettingVC.swift | 7 +- Mongle/Mongle/Source/VCs/MyTabVC.swift | 25 ++-- Mongle/Mongle/Source/VCs/ProfileEditVC.swift | 63 +++++++++- 15 files changed, 232 insertions(+), 58 deletions(-) create mode 100644 Mongle/Mongle/Resource/Assets.xcassets/mySettingsProfilePopupBg.imageset/Contents.json create mode 100644 Mongle/Mongle/Resource/Assets.xcassets/mySettingsProfilePopupBg.imageset/mySettingsProfilePopupBg.png create mode 100644 Mongle/Mongle/Resource/Assets.xcassets/mySettingsProfilePopupBg.imageset/mySettingsProfilePopupBg@2x.png create mode 100644 Mongle/Mongle/Resource/Assets.xcassets/mySettingsProfilePopupBg.imageset/mySettingsProfilePopupBg@3x.png create mode 100644 Mongle/Mongle/Resource/Assets.xcassets/mySettingsProfilePopupBox.imageset/Contents.json create mode 100644 Mongle/Mongle/Resource/Assets.xcassets/mySettingsProfilePopupBox.imageset/mySettingsProfilePopupBox.png create mode 100644 Mongle/Mongle/Resource/Assets.xcassets/mySettingsProfilePopupBox.imageset/mySettingsProfilePopupBox@2x.png create mode 100644 Mongle/Mongle/Resource/Assets.xcassets/mySettingsProfilePopupBox.imageset/mySettingsProfilePopupBox@3x.png create mode 100644 Mongle/Mongle/Source/Model/MyProfileUploadData.swift diff --git a/Mongle/Mongle.xcodeproj/project.pbxproj b/Mongle/Mongle.xcodeproj/project.pbxproj index 0fa08c1..1a57624 100644 --- a/Mongle/Mongle.xcodeproj/project.pbxproj +++ b/Mongle/Mongle.xcodeproj/project.pbxproj @@ -82,6 +82,7 @@ B83800F52525FF78009286AE /* PasswordChangeVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = B83800F42525FF78009286AE /* PasswordChangeVC.swift */; }; B83800F82525FFA2009286AE /* PasswordChange.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B83800F72525FFA2009286AE /* PasswordChange.storyboard */; }; B842A4462557E3B100253275 /* String+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = B842A4452557E3B100253275 /* String+Extensions.swift */; }; + B842A455255BBD4B00253275 /* MyProfileUploadData.swift in Sources */ = {isa = PBXBuildFile; fileRef = B842A454255BBD4A00253275 /* MyProfileUploadData.swift */; }; B85400A025513C1D004700B4 /* VersionInfo.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B854009F25513C1D004700B4 /* VersionInfo.storyboard */; }; B85400A6255143D7004700B4 /* AccountEditVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = B85400A5255143D7004700B4 /* AccountEditVC.swift */; }; B85400A9255143EC004700B4 /* AccountEdit.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B85400A8255143EC004700B4 /* AccountEdit.storyboard */; }; @@ -283,6 +284,7 @@ B83800F42525FF78009286AE /* PasswordChangeVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PasswordChangeVC.swift; sourceTree = ""; }; B83800F72525FFA2009286AE /* PasswordChange.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = PasswordChange.storyboard; sourceTree = ""; }; B842A4452557E3B100253275 /* String+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Extensions.swift"; sourceTree = ""; }; + B842A454255BBD4A00253275 /* MyProfileUploadData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyProfileUploadData.swift; sourceTree = ""; }; B854009F25513C1D004700B4 /* VersionInfo.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = VersionInfo.storyboard; sourceTree = ""; }; B85400A5255143D7004700B4 /* AccountEditVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountEditVC.swift; sourceTree = ""; }; B85400A8255143EC004700B4 /* AccountEdit.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = AccountEdit.storyboard; sourceTree = ""; }; @@ -606,6 +608,7 @@ B8E2E17824C29CD300595752 /* MyThemeData.swift */, B8E2E17C24C2AE3C00595752 /* MySentenceData.swift */, B8E2E18024C2B6F200595752 /* MyCuratorData.swift */, + B842A454255BBD4A00253275 /* MyProfileUploadData.swift */, ); path = Model; sourceTree = ""; @@ -699,14 +702,13 @@ B8E2E14A24BEE0A000595752 /* MyTabThemeVC.swift */, B8E2E14C24BEE0B000595752 /* MyTabSentenceVC.swift */, B8E2E14E24BEE0E900595752 /* MyTabCuratorVC.swift */, - B83800F42525FF78009286AE /* PasswordChangeVC.swift */, B85400A5255143D7004700B4 /* AccountEditVC.swift */, EC6E99C92508C9D900B57284 /* SignUpAgreeVC.swift */, EC523909250DF4ED0080BAF0 /* SignUpRuleVC.swift */, EC76E10425109D56009DDEF1 /* SignUpMainVC.swift */, EC771BB3254D4E210041603E /* SignUpServiceAgreeVC.swift */, EC30462B254ED0AA00DB6E4A /* ServiceAgreeForSignUpVC.swift */, - B83800F42525FF78009286AE /* PasswodChangeVC.swift */, + B83800F42525FF78009286AE /* PasswordChangeVC.swift */, ECF97E882556722000BF85AA /* SignUpEmailVC.swift */, ); path = VCs; @@ -1062,6 +1064,7 @@ B8E2E17724C29C9800595752 /* MyThemeService.swift in Sources */, EC759C4624BF7219001D2F81 /* BookSearchForWritingService.swift in Sources */, B8E2E15324C0586800595752 /* SearchMainService.swift in Sources */, + B842A455255BBD4B00253275 /* MyProfileUploadData.swift in Sources */, B8F4DDF824B210000075FDC1 /* RecentSearchCVC.swift in Sources */, 7FBFAB76255850CA0079FAC5 /* LoginRequestPopupView.swift in Sources */, 7FFEA28724BF768D003D381A /* EditorPickData.swift in Sources */, diff --git a/Mongle/Mongle/Resource/APIService/MyProfileService.swift b/Mongle/Mongle/Resource/APIService/MyProfileService.swift index fd21501..ee05437 100644 --- a/Mongle/Mongle/Resource/APIService/MyProfileService.swift +++ b/Mongle/Mongle/Resource/APIService/MyProfileService.swift @@ -14,6 +14,7 @@ struct MyProfileService { func getMy(completion : @escaping (NetworkResult) -> Void) { let header : HTTPHeaders = ["Content-Type" : "application/json","token":UserDefaults.standard.string(forKey:"token")!] + print(UserDefaults.standard.string(forKey:"token")!) let dataRequest = Alamofire.request(APIConstants.myProfileURL, method: .get, parameters: nil, @@ -23,16 +24,16 @@ struct MyProfileService { dataRequest.responseData { dataResponse in switch dataResponse.result { - case .success : - guard let statusCode = dataResponse.response?.statusCode else {return} - guard let data = dataResponse.result.value else {return} - let networkResult = self.judge(by: statusCode, data) - completion(networkResult) - - case .failure : - completion(.networkFail) - - + case .success : + guard let statusCode = dataResponse.response?.statusCode else {return} + guard let data = dataResponse.result.value else {return} + let networkResult = self.judge(flag: 1, by: statusCode, data) + completion(networkResult) + + case .failure : + completion(.networkFail) + + } @@ -41,44 +42,96 @@ struct MyProfileService { + } + func uploadMy(img: UIImage,name: String, introduce: String, keywordIdx: Int, completion : @escaping(NetworkResult) -> Void) { + let header: HTTPHeaders = [ + "Content-Type": "multipart/form-data", + "token":UserDefaults.standard.string(forKey:"token")!] + let body: Parameters = [ + "img": img, + "name": name, + "introduce": introduce, + "keywordIdx": keywordIdx + ] + Alamofire.upload(multipartFormData: {multiPartFormData in + + for (key,value) in body{ + if value is String{ + let val = value as! String + multiPartFormData.append(val.data(using:String.Encoding.utf8)!,withName:key) + print(key) + } + else if value is Int{ + let val = value as! Int + let convertedValueNumber: NSNumber = NSNumber(value: val) + let data = NSKeyedArchiver.archivedData(withRootObject: convertedValueNumber) + multiPartFormData.append(data, withName: key) + print(key) + } + else if value is UIImage{ + let imageData = img.jpegData(compressionQuality: 1.0)! + multiPartFormData.append(imageData,withName:key,mimeType:"image/jpeg") + print(key) + } + } + },usingThreshold:UInt64.init(), to: APIConstants.myProfileURL,method:.post, headers:header, encodingCompletion: { result in + switch result { + case .success(let upload,_,_): + upload.uploadProgress(closure: { (progress) in + print(progress.fractionCompleted) }) + upload.responseData { response in + guard let statusCode = response.response?.statusCode, let data = response.result.value else { return } + let networkResult = self.judge(flag: 2, by: statusCode, data) + completion(networkResult) + } + case .failure(let error): + print(error.localizedDescription) + completion(.networkFail) } + }) } - - private func judge(by statusCode : Int , _ data : Data) -> NetworkResult { + private func judge(flag: Int, by statusCode : Int , _ data : Data) -> NetworkResult { switch statusCode{ - case 200 : - return getMyProfile(by: data) - case 400: - return showErrorMessage(by : data) - case 600 : - return .serverErr - default : - return .networkFail - + case 200 : + return getMyProfile(flag: flag, by: data) + case 400: + return showErrorMessage(by : data) + case 600 : + return .serverErr + default : + return .networkFail } - } - private func getMyProfile(by data : Data) -> NetworkResult { - + private func getMyProfile(flag: Int, by data : Data) -> NetworkResult { + let decoder = JSONDecoder() - guard let decodedData = try? decoder.decode(GenericResponse<[MyProfileData]>.self, from: data) + if flag == 1{ + guard let decodedData = try? decoder.decode(GenericResponse<[MyProfileData]>.self, from: data) else { return .pathErr } - - - guard let data = decodedData.data else{ - return .requestErr("디코딩실패") + + guard let data = decodedData.data else{ + return .requestErr("디코딩실패") + } + return .success(data) + } + else{ + guard let decodedData = try? decoder.decode(GenericResponse<[MyProfileUploadData]>.self, from: data) + else { return .pathErr } + + guard let data = decodedData.data else{ + return .requestErr("디코딩실패") + } + return .success(data) } - - return .success(data) } private func showErrorMessage(by data : Data) -> NetworkResult { let decoder = JSONDecoder() guard let decodedData = try? decoder.decode(GenericResponse<[MyProfileData]>.self, from: data) - else { return .pathErr } + else { return .pathErr } print(decodedData.message) return .requestErr(decodedData.message) diff --git a/Mongle/Mongle/Resource/Assets.xcassets/mySettingsProfilePopupBg.imageset/Contents.json b/Mongle/Mongle/Resource/Assets.xcassets/mySettingsProfilePopupBg.imageset/Contents.json new file mode 100644 index 0000000..4435583 --- /dev/null +++ b/Mongle/Mongle/Resource/Assets.xcassets/mySettingsProfilePopupBg.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "mySettingsProfilePopupBg.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x", + "filename" : "mySettingsProfilePopupBg@2x.png" + }, + { + "idiom" : "universal", + "filename" : "mySettingsProfilePopupBg@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Mongle/Mongle/Resource/Assets.xcassets/mySettingsProfilePopupBg.imageset/mySettingsProfilePopupBg.png b/Mongle/Mongle/Resource/Assets.xcassets/mySettingsProfilePopupBg.imageset/mySettingsProfilePopupBg.png new file mode 100644 index 0000000000000000000000000000000000000000..d4b543515a516fce5ef16501e59f8daa2cbe8181 GIT binary patch literal 7022 zcmeAS@N?(olHy`uVBq!ia0y~yU@T`~VAkPa1B$E{d-NDcF%}28J29*~C-V}>u}F>Z zO!M_+&;qhK7#Q0#8CXC{fLIEM85o!rFu_C^%NH=i*vvX0NzcD8U4aUpc)B=-R4~51 za*&rnfrokHp(j0j{L3sPI~gB^L>d?0`_3Vt;Gm$g!8y`J(V>B%Q9t3%TqZ^)mL{fS zwh^m5SU3a>-sLqgFfutZK92&lGax3q#ogG0c99qits zoj|q6?(%|6)kwJ0ytK;&sQd9dHlRHMA_ngc2DvIZG&B^JGXst0;F9>Buu@4-!QsG; z-9UplSXg_iH-tua_1CLi O;CU}sKbLh*2~7ZUVGS1m literal 0 HcmV?d00001 diff --git a/Mongle/Mongle/Resource/Assets.xcassets/mySettingsProfilePopupBg.imageset/mySettingsProfilePopupBg@2x.png b/Mongle/Mongle/Resource/Assets.xcassets/mySettingsProfilePopupBg.imageset/mySettingsProfilePopupBg@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..a77f3c88f90259ef55fda360c977c17d91b8025a GIT binary patch literal 25055 zcmeI5&1(}u7>8#kOR|PU*Pcp^5^JhZJOuop2x3|y$sQU?@emLp7cJfrq*N4f>!I39 zOZ6^2crNxJ2I?UiN)d`6f?fhPcoHS_ASmd;nMrojelUpHYRSCy<5}MVqC2|!g_pL z*!mQ;jHpGKughSM?5szE^=MfiJhyt`lMp%K~5I7b-A=PZjPBv#~JP{o?0&YflZ_OCA7Ar zWi>BXGe-}F2E(08>ax8v(&SiQkR2d?qxg)PDq~>ehU}ePZJ2 zlir=G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VT&60w)QI~k|((8t03QP!p}ndGi+7d zjN?qq22h9tQ=_QW=Bt$dsy}X#+tVh%h8_$T!Ggof!eYcYP8*cd3B8<`T%ChA-|mUy zbmXzu$g@HAlcTyHRC=#S!8oq?(gC4T8o(a6-KSSB?~b)F|L9Vt^;k1(l9XL{XltMinC36`Ma379BL8StJ)oB)T0zI zO!q;Pg`UvN`2P26HLWc(Btn7l(fn@Z2h>AmkO%;D%Mjk@8%B!mQCKTQTwLR9S+CbQ zXkuK_6U7#3HH3zSy^cwK*L8c;#p*uN%-)aEdp1Ty2?X>`#Eq?2O5VOudnb6BR_*d= zX>Cke@t`6;=UrFD)HBc@+e?P8W>tGuU4X>GU&acW%H7NI$jKk^I-BB2`HK&Q z|F`m`oA7&vH~5A;6&|S^nI>zeDM&D#CEt)tE%aZvJ-dgTa_X<#xkF>y=^C8A_MIIJ zheNoUlPpAQtYZ`;amjQc)z2FJ z015zdgC)u(s@0n(H9CdP(pJ8zM4Ra0%et6WD)h~i6*t1t_>ANTmdO7@dn<;UQtxCa z6nji!>)D+uGM$~?4!3efz77r*p9lRDMx^M0=j2yq9Y`qNZspHv(pt+_X?Vd4#M}1WH(k&ml_T8OU hg`Uk(anuY3cx{NSjmtk_`Oklrv4OdM9m4JLe*g~5euw}7 literal 0 HcmV?d00001 diff --git a/Mongle/Mongle/Resource/Assets.xcassets/mySettingsProfilePopupBox.imageset/mySettingsProfilePopupBox@2x.png b/Mongle/Mongle/Resource/Assets.xcassets/mySettingsProfilePopupBox.imageset/mySettingsProfilePopupBox@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..647cc12f998c9cc594440373015470cd1b5415d6 GIT binary patch literal 12944 zcmeHu`9IX%A2w1dvQ)Ngb$1tqknGF2liX6FjAbmNCX`+Fb&{e8t;m{GG=s5kV~}k` zOk(VYG1f7Rea4KLd1l<-`}=*Kf8lxc!@SJ$Ip=)N`~AMIbDisRJh!}QdgSnl!(3ck zN6h}da*K~Bnkpl$3w+yS>tFLRajN-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%_}9BT^|1*T(E6> literal 0 HcmV?d00001 diff --git a/Mongle/Mongle/Resource/Assets.xcassets/mySettingsProfilePopupBox.imageset/mySettingsProfilePopupBox@3x.png b/Mongle/Mongle/Resource/Assets.xcassets/mySettingsProfilePopupBox.imageset/mySettingsProfilePopupBox@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..270b24e2892b468b8503348fdc1259a02bf8e419 GIT binary patch literal 20615 zcmeHPXIoQQ*G5D^QG-fR5P~|2(iQ0?j0~dEML=pqgwT5@G^LCnAR@iP07~zjgfetU zP>`_~(TEGr5Npd8lg(z<)%HUOX{YRHWbp{-&Wg5nxI|b@UbB#SFZF zN0TYZ@0|RQe3JY(rOeTXj!UY*4$>4){`md5%ZcT&GoNk^=yA-mtk&w9k3Y|n<&22@ zHv7>+%dG8VP3xY2VVsje-T5x>Tg4X|JL@*E4$6*O3-Z9V}gVn0ziv2!oLk^Q{*Wy zCDpLf1k!VhmP;(;Ja?BHXV61Q?lzghct0E4^-|u~28OMTMooW-XY#KfG;N|8Mj(tu zOYgX+m5p4t4^^&+b+-m=B1=f|2RhbOrY2_(hJ7hcP*Ty*u}iWLFYMi=~i=pNHrxUVVabv<0B=8D)S%3i51 zc!68mh_z33V@DI@igWP9M}nkjo+xWqE2a0t?Eetre~Ricl7>oKVZwQ3#M23;Ikntm z^x2vd#g9naMwB)A50+r3ualJ4!6`@+-+E-lOdtp{S`y;;$M_WI8#}9;H|5~LRhPEw7xoBuUQUV`qUkL>G2tbY(WbZW-ix7=`cNj?#+MQ@ztWoB#K3u*A8yO&-Zx zj3Bz*uDJYByk_|5@Zxu+IO2gKJso@8pI^8r3xS8N#-r7XLg|&+YAauq-O$gIyzBGk z9_VXdc*ZRN~J%UIo6MY>k6 z>_YYtw~kXf7X(uT^vDm=yuZmV9dh#ZJ)d_p`@07tkva3aPIBuLQQ1KxwMwMz4U;ad z%+|$}e3yl`04v1kL0H%IK3cN=JDfOS=fEOQ^Pa2VAaPkTfXNs+)=J=M5T9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kSr#%h#hH1biZ^^he&qmv8 ()) = { } var unSelectedTextfieldDelegate: (() -> ()) = { } + var introduceDelegate: ((String) -> ()) = { _ in } override func awakeFromNib() { super.awakeFromNib() introduceTextField.delegate = self - introduceTextField.text = MyProfileClass.shared.introduce ?? "" introduceTextField.addLeftPadding(left: 15) introduceTextField.makeRounded(cornerRadius: 10) introduceTextField.setBorder(borderColor: .veryLightPinkFive, borderWidth: 1) @@ -33,7 +33,9 @@ class ProfileEditIntroduceTVC: UITableViewCell { warningStackView = makeWarningStackView(message: "소개를 입력해주세요!", isCorrect: false) } - + override func touchesBegan(_ touches: Set, with event: UIEvent?){ + self.contentView.endEditing(true) + } override func setSelected(_ selected: Bool, animated: Bool) { } @objc func textFieldChanged(sender: UITextField){ @@ -108,6 +110,8 @@ extension ProfileEditIntroduceTVC: UITextFieldDelegate { func textFieldDidEndEditing(_ textField: UITextField) { textField.setBorder(borderColor: .veryLightPink, borderWidth: 1.0) unSelectedTextfieldDelegate() + introduceDelegate(textField.text!) + } diff --git a/Mongle/Mongle/Source/Model/MyProfileUploadData.swift b/Mongle/Mongle/Source/Model/MyProfileUploadData.swift new file mode 100644 index 0000000..6dcc9c3 --- /dev/null +++ b/Mongle/Mongle/Source/Model/MyProfileUploadData.swift @@ -0,0 +1,17 @@ +// +// MyProfileUploadData.swift +// Mongle +// +// Created by 이예슬 on 11/11/20. +// Copyright © 2020 이주혁. All rights reserved. +// + +import Foundation + +struct MyProfileUploadData: Codable { + var name: String + var img: String? + var introduce: String? + var keyword: String? + var keywordIdx: Int? +} diff --git a/Mongle/Mongle/Source/VCs/MySettingVC.swift b/Mongle/Mongle/Source/VCs/MySettingVC.swift index cc70165..00bed9e 100644 --- a/Mongle/Mongle/Source/VCs/MySettingVC.swift +++ b/Mongle/Mongle/Source/VCs/MySettingVC.swift @@ -19,9 +19,12 @@ class MySettingVC: UIViewController { } // MARK:- Property var settingSectionNames = ["개인 정보","문의","앱 정보"] - var settingRowNames = [["프로필 수정", "계정 설정", "푸쉬 알림 설정"],["1:1 문의하기","문제 신고하기"],["버전 정보","개발자 정보","서비스 운영정책","개인정보 처리방침","오픈소스 라이선스"]] + var settingRowNames = [["프로필 수정", "계정 설정", "푸쉬 알림 설정"],["1:1 문의하기"],["버전 정보","개발자 정보","서비스 운영정책","개인정보 이용약관","서비스 이용약관","오픈소스 라이선스"]] var isPushNotificationAllowed = false - + var name = "" + var introduce = "" + var profileImage = "" + var keywordIdx = 0 //MARK:- Lifecycle diff --git a/Mongle/Mongle/Source/VCs/MyTabVC.swift b/Mongle/Mongle/Source/VCs/MyTabVC.swift index a08a07d..c2f1534 100644 --- a/Mongle/Mongle/Source/VCs/MyTabVC.swift +++ b/Mongle/Mongle/Source/VCs/MyTabVC.swift @@ -8,6 +8,7 @@ import UIKit +let DidReceiveProfileNotification: Notification.Name = Notification.Name("DidReceiveProfile") class MyTabVC: UIViewController { var pageInstance : MyTabPageVC? @@ -22,6 +23,7 @@ class MyTabVC: UIViewController { var profileMsg : String = "" var profileKeyword : String? var profileKeywordIdx : Int? + var profileIntroduce = "" //MARK:- IBOutlet @IBOutlet weak var myProfileImage: UIImageView! @@ -170,9 +172,13 @@ class MyTabVC: UIViewController { } self.myProfileData = data[0] - self.profileImg = self.myProfileData!.img ?? "mongles" + self.profileImg = self.myProfileData!.img ?? "" self.profileName = self.myProfileData!.name self.profileKeywordIdx = self.myProfileData!.keywordIdx + self.profileIntroduce = self.myProfileData?.introduce ?? "" + print("여긴되잖아ㅅ.ㅂ.") +// let userInfo: [AnyHashable: Any] = ["name":self.profileName,"introduce":self.profileIntroduce,"profileImage":self.profileImg] + NotificationCenter.default.post(name: NSNotification.Name(rawValue: "DidReceiveProfile"), object: nil) switch self.myProfileData!.keywordIdx{ @@ -193,13 +199,7 @@ class MyTabVC: UIViewController { } - - MyProfileClass.shared.curatorIdx = self.myProfileData!.curatorIdx - MyProfileClass.shared.image = self.myProfileData?.img - MyProfileClass.shared.introduce = self.myProfileData?.introduce - MyProfileClass.shared.keywordIdx = self.myProfileData?.keywordIdx - MyProfileClass.shared.name = self.myProfileData!.name - MyProfileClass.shared.subscribe = self.myProfileData!.subscribe + DispatchQueue.main.async { self.setMenu() self.setProfile() @@ -339,15 +339,12 @@ class MyTabVC: UIViewController { } -class MyProfileClass{ - static let shared = MyProfileClass() - - private init(){} - +struct MyProfileStruct{ var curatorIdx: Int = 0 var name: String = "" - var image: String? + var image: UIImage? var introduce: String? var keywordIdx: Int? var subscribe: Int = 0 } + diff --git a/Mongle/Mongle/Source/VCs/ProfileEditVC.swift b/Mongle/Mongle/Source/VCs/ProfileEditVC.swift index f5815f3..699260a 100644 --- a/Mongle/Mongle/Source/VCs/ProfileEditVC.swift +++ b/Mongle/Mongle/Source/VCs/ProfileEditVC.swift @@ -8,7 +8,7 @@ import UIKit -class ProfileEditVC: UIViewController { +class ProfileEditVC: UIViewController{ // MARK:- IBOutlet @IBOutlet var profileImageView: UIImageView! @@ -47,24 +47,44 @@ class ProfileEditVC: UIViewController { var keywords: [String] = ["감성자극", "동기부여", "자기계발", "깊은생각", "독서기록", "일상문장"] var selectedKeywordIdx: Int = 0 var isScrollSpended: Bool = false + var name: String = "" + var profileImage: String? + var introduce: String = "" + var userProfileData: MyProfileData? // MARK:- Lifecycle override func viewDidLoad() { super.viewDidLoad() + setLayout() setKeywordButton() updateSelectedKeywordButton() setGesture() - setData() // Do any additional setup after loading the view. } override func viewWillAppear(_ animated: Bool) { + updateSelectedKeywordButton() registerForKeyboardNotifications() + NotificationCenter.default.addObserver(self, selector: #selector(setUserProfileData(_:)), name: NSNotification.Name(rawValue: "DidReceiveProfile"), object: nil) + setData() + } + @objc func setUserProfileData(_ notification: Notification){ + print("ㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗ") +// self.name = notification.userInfo?["name"] as? String ?? "" +// self.introduce = notification.userInfo?["introduce"] as? String ?? "" +// self.selectedKeywordIdx = notification.userInfo?["keywordIdx"] as? Int ?? 0 +// self.profileImage = notification.userInfo?["profileImage"] as? String ?? "" +// let data = notification.object as! MyProfileData +// self.introduce = data.introduce ?? "" +// self.selectedKeywordIdx = data.keywordIdx ?? 0 +// self.profileImage = data.img + print("들어오나\(self.name),\(self.introduce)") } override func viewWillDisappear(_ animated: Bool) { unregisterForKeyboardNotifications() + NotificationCenter.default.removeObserver(self,name: NSNotification.Name(rawValue: "DidReceiveProfile"),object:nil) } func registerForKeyboardNotifications() { @@ -163,9 +183,9 @@ class ProfileEditVC: UIViewController { } } func setData(){ - self.nickNameTextField.text = MyProfileClass.shared.name - self.profileImageView.image = UIImage(named:MyProfileClass.shared.image ?? "mySettingsProfile4ImgProfile") - self.keywordButton[MyProfileClass.shared.keywordIdx ?? 0].tag = MyProfileClass.shared.keywordIdx ?? 0 + self.nickNameTextField.text = self.name + self.profileImageView.imageFromUrl(profileImage, defaultImgPath: "mySettingsProfile4BtnProfileChange") + self.layoutTableView.reloadData() updateSelectedKeywordButton() } func testValidInput(){ @@ -247,7 +267,7 @@ class ProfileEditVC: UIViewController { return stackView } - + //MARK: - IBAction @IBAction func touchKeywordButton(sender: UIButton) { selectedKeywordIdx = sender.tag updateSelectedKeywordButton() @@ -260,6 +280,33 @@ class ProfileEditVC: UIViewController { @IBAction func touchUpCompleteButton(){ testValidInput() layoutTableView.reloadData() + MyProfileService.shared.uploadMy(img: profileImageView.image ?? UIImage(named:"warning")!, name: nickNameTextField.text!, introduce: self.introduce , keywordIdx: selectedKeywordIdx, completion: { networkResult in + switch networkResult{ + case .success(let data): + print("<<<<<성공>>>>>") + guard let profileData = data as? MyProfileUploadData else{ + return + } + self.name = profileData.name + self.profileImage = profileData.img + self.introduce = profileData.introduce ?? "" + self.selectedKeywordIdx = profileData.keywordIdx ?? 0 + let userInfo: [AnyHashable: Any] = ["name":self.name,"introduce":self.introduce,"profileImage":self.profileImage!] +// NotificationCenter.default.post(name: NSNotification.Name("ProfileData"), object: nil, userInfo: userInfo) + + case .requestErr(let message): + guard let message = message as? String else { return } + self.showToast(text: message) + print(message) + case .pathErr: + print("pathErr") + case .serverErr: + print("serverErr") + case .networkFail: + print("networkFail") + } + } + ) } } @@ -302,6 +349,10 @@ extension ProfileEditVC: UITableViewDataSource { cell.unSelectedTextfieldDelegate = { [weak self] in self?.isScrollSpended = false } + cell.introduceDelegate = { text in + self.introduce = text + } + cell.introduceTextField.text = introduce return cell } else { From a7d78b4ecd05fca69fa79bf7baebd59d58fe6deb Mon Sep 17 00:00:00 2001 From: seu11ee Date: Thu, 12 Nov 2020 13:34:53 +0900 Subject: [PATCH 4/5] =?UTF-8?q?UserProfile=20UserDefaults=EC=97=90=20?= =?UTF-8?q?=EC=A0=80=EC=9E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../APIService/MyProfileService.swift | 3 +- .../Resource/APIService/SignInService.swift | 6 --- Mongle/Mongle/Source/VCs/MyTabVC.swift | 8 +-- Mongle/Mongle/Source/VCs/ProfileEditVC.swift | 49 ++++++------------- 4 files changed, 22 insertions(+), 44 deletions(-) diff --git a/Mongle/Mongle/Resource/APIService/MyProfileService.swift b/Mongle/Mongle/Resource/APIService/MyProfileService.swift index ee05437..ebcae0c 100644 --- a/Mongle/Mongle/Resource/APIService/MyProfileService.swift +++ b/Mongle/Mongle/Resource/APIService/MyProfileService.swift @@ -69,7 +69,8 @@ struct MyProfileService { print(key) } else if value is UIImage{ - let imageData = img.jpegData(compressionQuality: 1.0)! + let image = value as! UIImage + let imageData = image.jpegData(compressionQuality: 1.0)! multiPartFormData.append(imageData,withName:key,mimeType:"image/jpeg") print(key) } diff --git a/Mongle/Mongle/Resource/APIService/SignInService.swift b/Mongle/Mongle/Resource/APIService/SignInService.swift index 044ed44..c95cf90 100644 --- a/Mongle/Mongle/Resource/APIService/SignInService.swift +++ b/Mongle/Mongle/Resource/APIService/SignInService.swift @@ -39,16 +39,10 @@ struct SignInService { case .failure : completion(.networkFail) - } - } - - - - } private func judge(by statusCode : Int , _ data : Data) -> NetworkResult { diff --git a/Mongle/Mongle/Source/VCs/MyTabVC.swift b/Mongle/Mongle/Source/VCs/MyTabVC.swift index c2f1534..2c29e2f 100644 --- a/Mongle/Mongle/Source/VCs/MyTabVC.swift +++ b/Mongle/Mongle/Source/VCs/MyTabVC.swift @@ -8,7 +8,6 @@ import UIKit -let DidReceiveProfileNotification: Notification.Name = Notification.Name("DidReceiveProfile") class MyTabVC: UIViewController { var pageInstance : MyTabPageVC? @@ -176,9 +175,10 @@ class MyTabVC: UIViewController { self.profileName = self.myProfileData!.name self.profileKeywordIdx = self.myProfileData!.keywordIdx self.profileIntroduce = self.myProfileData?.introduce ?? "" - print("여긴되잖아ㅅ.ㅂ.") -// let userInfo: [AnyHashable: Any] = ["name":self.profileName,"introduce":self.profileIntroduce,"profileImage":self.profileImg] - NotificationCenter.default.post(name: NSNotification.Name(rawValue: "DidReceiveProfile"), object: nil) + UserDefaults.standard.setValue(self.profileName, forKey: "UserProfileName") + UserDefaults.standard.setValue(self.profileImg, forKey: "UserProfileImgLink") + UserDefaults.standard.setValue(self.profileKeywordIdx, forKey: "UserProfileKeyIdx") + UserDefaults.standard.setValue(self.profileIntroduce, forKey: "UserProfileIntroduce") switch self.myProfileData!.keywordIdx{ diff --git a/Mongle/Mongle/Source/VCs/ProfileEditVC.swift b/Mongle/Mongle/Source/VCs/ProfileEditVC.swift index 699260a..91751d8 100644 --- a/Mongle/Mongle/Source/VCs/ProfileEditVC.swift +++ b/Mongle/Mongle/Source/VCs/ProfileEditVC.swift @@ -50,7 +50,6 @@ class ProfileEditVC: UIViewController{ var name: String = "" var profileImage: String? var introduce: String = "" - var userProfileData: MyProfileData? // MARK:- Lifecycle override func viewDidLoad() { @@ -60,27 +59,15 @@ class ProfileEditVC: UIViewController{ setKeywordButton() updateSelectedKeywordButton() setGesture() - // Do any additional setup after loading the view. + } override func viewWillAppear(_ animated: Bool) { updateSelectedKeywordButton() registerForKeyboardNotifications() - NotificationCenter.default.addObserver(self, selector: #selector(setUserProfileData(_:)), name: NSNotification.Name(rawValue: "DidReceiveProfile"), object: nil) setData() } - @objc func setUserProfileData(_ notification: Notification){ - print("ㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗ") -// self.name = notification.userInfo?["name"] as? String ?? "" -// self.introduce = notification.userInfo?["introduce"] as? String ?? "" -// self.selectedKeywordIdx = notification.userInfo?["keywordIdx"] as? Int ?? 0 -// self.profileImage = notification.userInfo?["profileImage"] as? String ?? "" -// let data = notification.object as! MyProfileData -// self.introduce = data.introduce ?? "" -// self.selectedKeywordIdx = data.keywordIdx ?? 0 -// self.profileImage = data.img - print("들어오나\(self.name),\(self.introduce)") - } + override func viewWillDisappear(_ animated: Bool) { unregisterForKeyboardNotifications() @@ -137,7 +124,6 @@ class ProfileEditVC: UIViewController{ self.present(self.imagePickerController, animated: true, completion: nil) } - // MARK: Custom Method func setLayout(){ keywordBackgroundView.backgroundColor = UIColor.veryLightPinkEight @@ -147,22 +133,19 @@ class ProfileEditVC: UIViewController{ nickNameTextField.makeRounded(cornerRadius: 10) nickNameTextField.setBorder(borderColor: .veryLightPinkFive, borderWidth: 1) - nickNameTextField.addLeftPadding(left: 15) -// introduceTextField.addLeftPadding(left: 15) completeButton.makeRounded(cornerRadius: 28) -// nickNameTextField.textRect(forBounds: CGRect(x: 0, y: 0, width: 20, height: 10)) + } func setKeywordButton(){ - var idx: Int = 0 + var idx: Int = 1 keywordButton.forEach { - $0.setTitle(keywords[idx], for: .normal) + $0.setTitle(keywords[idx-1], for: .normal) $0.titleLabel?.font = UIFont.systemFont(ofSize: 13) $0.setTitleColor(UIColor(red: 124 / 255, green: 124 / 255, blue: 124 / 255, alpha: 1.0), for: .normal) - $0.setTitleColor(.white, for: .selected) $0.backgroundColor = .white $0.tag = idx @@ -183,9 +166,11 @@ class ProfileEditVC: UIViewController{ } } func setData(){ - self.nickNameTextField.text = self.name - self.profileImageView.imageFromUrl(profileImage, defaultImgPath: "mySettingsProfile4BtnProfileChange") +// userProfileData = UserDefaults.standard.object(forKey: "UserProfile") as! MyProfileData + self.nickNameTextField.text = UserDefaults.standard.string(forKey: "UserProfileName") + self.profileImageView.imageFromUrl(UserDefaults.standard.string(forKey: "UserProfileImgLink"), defaultImgPath: "mySettingsProfile4BtnProfileChange") self.layoutTableView.reloadData() + selectedKeywordIdx = UserDefaults.standard.integer(forKey: "UserProfileKeyIdx") ?? 0 updateSelectedKeywordButton() } func testValidInput(){ @@ -280,19 +265,17 @@ class ProfileEditVC: UIViewController{ @IBAction func touchUpCompleteButton(){ testValidInput() layoutTableView.reloadData() - MyProfileService.shared.uploadMy(img: profileImageView.image ?? UIImage(named:"warning")!, name: nickNameTextField.text!, introduce: self.introduce , keywordIdx: selectedKeywordIdx, completion: { networkResult in + MyProfileService.shared.uploadMy(img: profileImageView.image ?? UIImage(named:"warning")!, name: nickNameTextField.text!, introduce: UserDefaults.standard.string(forKey: "UserProfileIntroduce") ?? "" , keywordIdx: selectedKeywordIdx, completion: { networkResult in switch networkResult{ case .success(let data): print("<<<<<성공>>>>>") guard let profileData = data as? MyProfileUploadData else{ return } - self.name = profileData.name - self.profileImage = profileData.img - self.introduce = profileData.introduce ?? "" - self.selectedKeywordIdx = profileData.keywordIdx ?? 0 - let userInfo: [AnyHashable: Any] = ["name":self.name,"introduce":self.introduce,"profileImage":self.profileImage!] -// NotificationCenter.default.post(name: NSNotification.Name("ProfileData"), object: nil, userInfo: userInfo) + UserDefaults.standard.setValue(profileData.name, forKey: "UserProfileName") + UserDefaults.standard.setValue(profileData.img, forKey: "UserProfileImgLink") + UserDefaults.standard.setValue(profileData.introduce, forKey: "UserProfileIntroduce") + UserDefaults.standard.setValue(profileData.keywordIdx, forKey: "UserProfileKeyIdx") case .requestErr(let message): guard let message = message as? String else { return } @@ -350,9 +333,9 @@ extension ProfileEditVC: UITableViewDataSource { self?.isScrollSpended = false } cell.introduceDelegate = { text in - self.introduce = text + UserDefaults.standard.setValue(text, forKey: "UserProfileIntroduce") } - cell.introduceTextField.text = introduce + cell.introduceTextField.text = UserDefaults.standard.string(forKey: "UserProfileIntroduce") return cell } else { From 04795d3cac31bd3ee0cc9c9844fd8a0fce72465e Mon Sep 17 00:00:00 2001 From: seu11ee Date: Thu, 12 Nov 2020 16:20:26 +0900 Subject: [PATCH 5/5] =?UTF-8?q?keywordIdx=20=EC=8A=A4=ED=8A=B8=EB=A7=81?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C..?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Mongle/Mongle/Info.plist | 2 +- .../APIService/MyProfileService.swift | 24 ++--- .../MySetting/ProfileEdit.storyboard | 16 +--- Mongle/Mongle/Source/VCs/ProfileEditVC.swift | 95 ++++++++++++++++--- 4 files changed, 94 insertions(+), 43 deletions(-) diff --git a/Mongle/Mongle/Info.plist b/Mongle/Mongle/Info.plist index f9691a6..d6a01c7 100644 --- a/Mongle/Mongle/Info.plist +++ b/Mongle/Mongle/Info.plist @@ -54,7 +54,7 @@ UISceneDelegateClassName $(PRODUCT_MODULE_NAME).SceneDelegate UISceneStoryboardFile - UnderTab + LogIn diff --git a/Mongle/Mongle/Resource/APIService/MyProfileService.swift b/Mongle/Mongle/Resource/APIService/MyProfileService.swift index ebcae0c..b34f088 100644 --- a/Mongle/Mongle/Resource/APIService/MyProfileService.swift +++ b/Mongle/Mongle/Resource/APIService/MyProfileService.swift @@ -38,9 +38,7 @@ struct MyProfileService { } - - - + } func uploadMy(img: UIImage,name: String, introduce: String, keywordIdx: Int, completion : @escaping(NetworkResult) -> Void) { @@ -48,13 +46,14 @@ struct MyProfileService { "Content-Type": "multipart/form-data", "token":UserDefaults.standard.string(forKey:"token")!] let body: Parameters = [ - "img": img, "name": name, "introduce": introduce, "keywordIdx": keywordIdx ] Alamofire.upload(multipartFormData: {multiPartFormData in - + let imageData = img.jpegData(compressionQuality: 1.0)! + multiPartFormData.append(imageData,withName:"img",mimeType:"image/jpeg") + print("img") for (key,value) in body{ if value is String{ let val = value as! String @@ -65,16 +64,17 @@ struct MyProfileService { let val = value as! Int let convertedValueNumber: NSNumber = NSNumber(value: val) let data = NSKeyedArchiver.archivedData(withRootObject: convertedValueNumber) - multiPartFormData.append(data, withName: key) - print(key) - } - else if value is UIImage{ - let image = value as! UIImage - let imageData = image.jpegData(compressionQuality: 1.0)! - multiPartFormData.append(imageData,withName:key,mimeType:"image/jpeg") + multiPartFormData.append("\(val)".data(using:String.Encoding.utf8)!, withName: key) print(key) } +// else if value is UIImage{ +// let image = value as! UIImage +// let imageData = image.jpegData(compressionQuality: 1.0)! +// multiPartFormData.append(imageData,withName:key,mimeType:"image/jpeg") +// print(key) +// } } + },usingThreshold:UInt64.init(), to: APIConstants.myProfileURL,method:.post, headers:header, encodingCompletion: { result in switch result { case .success(let upload,_,_): diff --git a/Mongle/Mongle/Resource/Storyboard/MySetting/ProfileEdit.storyboard b/Mongle/Mongle/Resource/Storyboard/MySetting/ProfileEdit.storyboard index 12584e3..a6a9400 100644 --- a/Mongle/Mongle/Resource/Storyboard/MySetting/ProfileEdit.storyboard +++ b/Mongle/Mongle/Resource/Storyboard/MySetting/ProfileEdit.storyboard @@ -279,6 +279,7 @@ + @@ -300,21 +301,6 @@ - - - - - - - - - - - - - - - diff --git a/Mongle/Mongle/Source/VCs/ProfileEditVC.swift b/Mongle/Mongle/Source/VCs/ProfileEditVC.swift index 91751d8..2f69721 100644 --- a/Mongle/Mongle/Source/VCs/ProfileEditVC.swift +++ b/Mongle/Mongle/Source/VCs/ProfileEditVC.swift @@ -11,6 +11,7 @@ import UIKit class ProfileEditVC: UIViewController{ // MARK:- IBOutlet + @IBOutlet weak var backButton: UIButton! @IBOutlet var profileImageView: UIImageView! @IBOutlet var nickNameTextField: UITextField! { didSet { @@ -43,6 +44,30 @@ class ProfileEditVC: UIViewController{ lazy var nickNameWarningStackView = UIStackView() lazy var introduceWarningStackView = UIStackView() + let blurImageView = UIImageView().then{ + $0.image = UIImage(named: "passwordChangePopupBg") + } + let popupView = UIView().then{ + $0.backgroundColor = .clear + } + var popupImageView = UIImageView().then{ + $0.image = UIImage(named: "mySettingsProfilePopupBox") + } + var popupTitleLabel = UILabel().then{ + $0.font = UIFont(name: "AppleSDGothicNeo-Regular", size: 15) + $0.textColor = .black + $0.adjustsFontSizeToFitWidth = true + } + + var yesButton = UIButton().then{ + $0.setTitle("확인", for: .normal) + $0.setTitleColor(.white, for: .normal) + $0.backgroundColor = .softGreen + $0.makeRounded(cornerRadius: 19) + $0.addTarget(self, action: #selector(yesButtonAction), for: .touchUpInside) + $0.titleLabel?.font = $0.titleLabel?.font.withSize(13) + } + // MARK: Property var keywords: [String] = ["감성자극", "동기부여", "자기계발", "깊은생각", "독서기록", "일상문장"] var selectedKeywordIdx: Int = 0 @@ -50,6 +75,8 @@ class ProfileEditVC: UIViewController{ var name: String = "" var profileImage: String? var introduce: String = "" + let heightRatio: CGFloat = UIScreen.main.bounds.height/812 + let widthRatio: CGFloat = UIScreen.main.bounds.width/375 // MARK:- Lifecycle override func viewDidLoad() { @@ -71,7 +98,6 @@ class ProfileEditVC: UIViewController{ override func viewWillDisappear(_ animated: Bool) { unregisterForKeyboardNotifications() - NotificationCenter.default.removeObserver(self,name: NSNotification.Name(rawValue: "DidReceiveProfile"),object:nil) } func registerForKeyboardNotifications() { @@ -123,7 +149,9 @@ class ProfileEditVC: UIViewController{ @objc func touchUpProfileImageView(){ self.present(self.imagePickerController, animated: true, completion: nil) } - + @objc func yesButtonAction(){ + self.navigationController?.popViewController(animated: true) + } // MARK: Custom Method func setLayout(){ keywordBackgroundView.backgroundColor = UIColor.veryLightPinkEight @@ -251,6 +279,52 @@ class ProfileEditVC: UIViewController{ return stackView } + func showPopupView(_ popupTitle: String, _ popupText: String){ + + self.view.addSubview(blurImageView) + self.view.addSubview(popupView) + self.popupView.addSubview(popupImageView) + self.popupView.addSubview(popupTitleLabel) + self.popupView.addSubview(yesButton) + //constraints + self.popupTitleLabel.text = popupTitle + self.blurImageView.snp.makeConstraints{ + $0.top.bottom.leading.trailing.equalToSuperview() + } + self.popupView.snp.makeConstraints { + $0.top.equalToSuperview().offset(310*heightRatio) + $0.leading.equalToSuperview().offset(35*widthRatio) + $0.bottom.equalToSuperview().offset(-309*heightRatio) + $0.trailing.equalToSuperview().offset(-35*widthRatio) + } + self.popupImageView.snp.makeConstraints{ + $0.top.bottom.leading.trailing.equalToSuperview() + } + self.popupTitleLabel.snp.makeConstraints{ + $0.top.equalToSuperview().offset(81*heightRatio) + $0.bottom.equalToSuperview().offset(-94*heightRatio) + $0.centerX.equalToSuperview() + } + + self.yesButton.snp.makeConstraints{ + $0.top.equalToSuperview().offset(131*heightRatio) + $0.bottom.equalToSuperview().offset(-25*heightRatio) + $0.leading.equalToSuperview().offset(88*widthRatio) + $0.trailing.equalToSuperview().offset(-88*widthRatio) + } + //뒤에 있는 컴포넌트 안눌리게 + nickNameTextField.isUserInteractionEnabled = false + keywordButton.forEach { + $0.isUserInteractionEnabled = false + } + backButton.isUserInteractionEnabled = false + completeButton.isUserInteractionEnabled = false +// nowPasswordTextField.isUserInteractionEnabled = false +// newPasswordTextField.isUserInteractionEnabled = false +// newPasswordCheckTextField.isUserInteractionEnabled = false +// completeButton.isUserInteractionEnabled = false + + } //MARK: - IBAction @IBAction func touchKeywordButton(sender: UIButton) { @@ -265,12 +339,13 @@ class ProfileEditVC: UIViewController{ @IBAction func touchUpCompleteButton(){ testValidInput() layoutTableView.reloadData() - MyProfileService.shared.uploadMy(img: profileImageView.image ?? UIImage(named:"warning")!, name: nickNameTextField.text!, introduce: UserDefaults.standard.string(forKey: "UserProfileIntroduce") ?? "" , keywordIdx: selectedKeywordIdx, completion: { networkResult in + showPopupView("프로필이 수정되었어요!", "") + MyProfileService.shared.uploadMy(img: profileImageView.image ?? UIImage(named:"warning")!, name: nickNameTextField.text!, introduce: self.introduce ?? "" , keywordIdx: selectedKeywordIdx, completion: { networkResult in switch networkResult{ case .success(let data): print("<<<<<성공>>>>>") guard let profileData = data as? MyProfileUploadData else{ - return + return } UserDefaults.standard.setValue(profileData.name, forKey: "UserProfileName") UserDefaults.standard.setValue(profileData.img, forKey: "UserProfileImgLink") @@ -333,7 +408,7 @@ extension ProfileEditVC: UITableViewDataSource { self?.isScrollSpended = false } cell.introduceDelegate = { text in - UserDefaults.standard.setValue(text, forKey: "UserProfileIntroduce") + self.introduce = text } cell.introduceTextField.text = UserDefaults.standard.string(forKey: "UserProfileIntroduce") return cell @@ -360,13 +435,3 @@ extension ProfileEditVC: UIImagePickerControllerDelegate, UINavigationController self.dismiss(animated: true, completion: nil) } } - -//extension ProfileEditVC: UIGestureRecognizerDelegate { -// func gestureRecognizer(_ gestrueRecognizer: UIGestureRecognizer, shouldReceive touch: UITouch) -> Bool { -// if (touch.view?.isDescendant(of: nickNameTextField))! || (touch.view?.isDescendant(of: self.textfield))! { -// -// return false -// } -// return true -// } -//}