From 4dc2bb52cb635bf4615918ea3b20d2362f3a84a6 Mon Sep 17 00:00:00 2001 From: Juhyeoklee Date: Thu, 26 Nov 2020 04:02:07 +0900 Subject: [PATCH 01/11] [update] write in theme enable paste --- .../Source/VCs/WritingSentenceInThemeVC.swift | 40 +++++++++++++------ 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/Mongle/Mongle/Source/VCs/WritingSentenceInThemeVC.swift b/Mongle/Mongle/Source/VCs/WritingSentenceInThemeVC.swift index e793358..f72ad23 100644 --- a/Mongle/Mongle/Source/VCs/WritingSentenceInThemeVC.swift +++ b/Mongle/Mongle/Source/VCs/WritingSentenceInThemeVC.swift @@ -53,8 +53,8 @@ class WritingSentenceInThemeVC: UIViewController { //MARK:- Property var isInitial: Bool = true - var text: String = "" - + var inputText: String = "" + var initialText: String = "" //MARK:- LifeCycle Method override func viewDidLoad() { @@ -68,7 +68,7 @@ class WritingSentenceInThemeVC: UIViewController { override func viewWillAppear(_ animated: Bool) { registerForKeyboardNotifications() sentenceTextView.becomeFirstResponder() - print(#function) + } override func viewWillDisappear(_ animated: Bool) { @@ -285,28 +285,42 @@ class WritingSentenceInThemeVC: UIViewController { extension WritingSentenceInThemeVC: UITextViewDelegate { func textViewShouldBeginEditing(_ textView: UITextView) -> Bool { -// -// textView.text = """ -// 최대 280자까지 입력 가능하며, 책의 문장을 임의로 -// 변형하지 않게 주의해주세요! -// """ + let position = textView.beginningOfDocument textView.selectedTextRange = textView.textRange(from:position, to:position) return true } - func textViewDidChange(_ textView: UITextView) { + func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool { + + if isInitial { + + textView.text = "" + initialText = text + textView.textColor = .black + } + + var newText = inputText + text + if newText.count > 280 { + inputText = String(newText.prefix(280)) + } + + + return true + } + + func textViewDidChange(_ textView: UITextView) { + if isInitial { - let char = textView.text[textView.text.startIndex] - textView.text = "\(char)" + textView.text = initialText textView.textColor = .black } if textView.text.count > 280 { - textView.text = text + textView.text = inputText } - text = textView.text + inputText = textView.text self.isInitial = false setAttributeCountLabel(count: textView.text.count) From 2714ffc0efa0041d85f4ff234206b9f7aefa3920 Mon Sep 17 00:00:00 2001 From: seu11ee Date: Fri, 27 Nov 2020 14:16:27 +0900 Subject: [PATCH 02/11] [fix] add pan gesture recognizer to search tab --- Mongle/Mongle.xcodeproj/project.pbxproj | 4 ++-- Mongle/Mongle/Source/VCs/SearchTabMainVC.swift | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Mongle/Mongle.xcodeproj/project.pbxproj b/Mongle/Mongle.xcodeproj/project.pbxproj index ef0cda5..76e14be 100644 --- a/Mongle/Mongle.xcodeproj/project.pbxproj +++ b/Mongle/Mongle.xcodeproj/project.pbxproj @@ -1307,7 +1307,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 6ZTQ76LJPZ; + DEVELOPMENT_TEAM = 4YXV56BSN6; INFOPLIST_FILE = Mongle/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = ( @@ -1315,7 +1315,7 @@ "@executable_path/Frameworks", ); MARKETING_VERSION = 1.11; - PRODUCT_BUNDLE_IDENTIFIER = io.github.juhyeoklee.Mongle12; + PRODUCT_BUNDLE_IDENTIFIER = io.github.juhyeoklee.Mongle; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 1; diff --git a/Mongle/Mongle/Source/VCs/SearchTabMainVC.swift b/Mongle/Mongle/Source/VCs/SearchTabMainVC.swift index e66463a..750d017 100644 --- a/Mongle/Mongle/Source/VCs/SearchTabMainVC.swift +++ b/Mongle/Mongle/Source/VCs/SearchTabMainVC.swift @@ -13,7 +13,7 @@ class SearchTabMainVC: UIViewController{ var recentKeyArray : [String] = [] var recommendKeyArray : [String] = [] var searchKey : String? - + var screenEdgePanRecognizer: UIScreenEdgePanGestureRecognizer! // MARK:- IBOutlet @IBOutlet weak var searchTextField: UITextField! @IBOutlet weak var recentSearchCV: UICollectionView! @@ -31,6 +31,7 @@ class SearchTabMainVC: UIViewController{ initGestureRecognizer() setCollctionViewLayout() + self.view.addGestureRecognizer(screenEdgePanRecognizer) self.navigationController?.interactivePopGestureRecognizer?.delegate = self // self.navigationController?.hidesBottomBarWhenPushed = false @@ -152,6 +153,8 @@ class SearchTabMainVC: UIViewController{ //MARK:- Set Gesture func initGestureRecognizer() { + screenEdgePanRecognizer = UIScreenEdgePanGestureRecognizer(target: self, action: #selector(selectPreVC)) + screenEdgePanRecognizer.edges = .left let textFieldTap = UITapGestureRecognizer(target: self, action: #selector(handleTapTextField(_:))) textFieldTap.delegate = self self.view.addGestureRecognizer(textFieldTap) @@ -166,6 +169,10 @@ class SearchTabMainVC: UIViewController{ guard let duration = notification.userInfo?[UIResponder.keyboardAnimationDurationUserInfoKey] as? Double else {return} guard let curve = notification.userInfo?[UIResponder.keyboardAnimationCurveUserInfoKey] as? UInt else {return} } + @objc func selectPreVC(){ + UIView.animate(withDuration: 0.1, animations: {self.tabBarController?.selectedIndex = self.prevIdx!}) + + } // MARK:- register/unregister Notification Observer // observer func registerForKeyboardNotifications() { @@ -210,8 +217,7 @@ class SearchTabMainVC: UIViewController{ } @IBAction func touchUpBack(_ sender: Any) { -// self.navigationController?.popViewController(animated: true) -// self.showToast(text: "뒤로가기") + self.tabBarController?.selectedIndex = prevIdx! } @IBAction func removeSearchHistoryBTN(_ sender: Any) { From 578897bbbc69bb9a93a6d5fff482aae4d1dc699f Mon Sep 17 00:00:00 2001 From: seu11ee Date: Fri, 27 Nov 2020 14:29:05 +0900 Subject: [PATCH 03/11] =?UTF-8?q?[fix]=20=ED=86=B5=EC=8B=A0=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=ED=94=84=EB=A6=B0=ED=8A=B8=EB=AC=B8=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Mongle/Source/VCs/SearchTabMainVC.swift | 32 +++++++++---------- .../Mongle/Source/VCs/SearchTabResultVC.swift | 2 ++ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Mongle/Mongle/Source/VCs/SearchTabMainVC.swift b/Mongle/Mongle/Source/VCs/SearchTabMainVC.swift index 750d017..d55f2dd 100644 --- a/Mongle/Mongle/Source/VCs/SearchTabMainVC.swift +++ b/Mongle/Mongle/Source/VCs/SearchTabMainVC.swift @@ -71,15 +71,15 @@ class SearchTabMainVC: UIViewController{ guard let message = message as? String else { return } self.simpleAlert(title: "error", message: message) - self.showToast(text: message) - print("ㅁㅁ\(message)") +// self.showToast(text: message) + print("\(message)") case .pathErr: - print("ㅁㅁpath") + print("path") case .serverErr: - print("ㅁㅁserverErr") + print("serverErr") case .networkFail: - print("ㅁㅁnetworkFail") + print("networkFail") } @@ -94,7 +94,6 @@ class SearchTabMainVC: UIViewController{ } self.recommendKeyArray = data - print("ㅁㅁㅁㅁㅁ추천검색어\(data)ㅁㅁㅁㅁㅁ") DispatchQueue.main.async { self.recommendSearchCV.reloadData() } @@ -104,15 +103,15 @@ class SearchTabMainVC: UIViewController{ guard let message = message as? String else { return } self.simpleAlert(title: "error", message: message) - self.showToast(text: message) - print("ㅁㅁ\(message)") +// self.showToast(text: message) + print(message) case .pathErr: - print("ㅁㅁpath") + print("pathErr") case .serverErr: - print("ㅁㅁserverErr") + print("serverErr") case .networkFail: - print("ㅁㅁnetworkFail") + print("networkFail") } @@ -122,7 +121,6 @@ class SearchTabMainVC: UIViewController{ SearchMainService.shared.deleteRecentSearch() { networkResult in switch networkResult { case .success(let message): - print("qqqqqqqqqqq\(message)") guard let message = message as? String else { return } // self.showToast("최근 검색어가 전체삭제 되었어요!") print(message) @@ -136,15 +134,15 @@ class SearchTabMainVC: UIViewController{ guard let message = message as? String else { return } self.simpleAlert(title: "error", message: message) - self.showToast(text: message) - print("ㅁㅁ\(message)") +// self.showToast(text: message) + print(message) case .pathErr: - print("ㅁㅁpath") + print("pathErr") case .serverErr: - print("ㅁㅁserverErr") + print("serverErr") case .networkFail: - print("ㅁㅁnetworkFail") + print("networkFail") } diff --git a/Mongle/Mongle/Source/VCs/SearchTabResultVC.swift b/Mongle/Mongle/Source/VCs/SearchTabResultVC.swift index f1f16fe..65400c2 100644 --- a/Mongle/Mongle/Source/VCs/SearchTabResultVC.swift +++ b/Mongle/Mongle/Source/VCs/SearchTabResultVC.swift @@ -50,6 +50,8 @@ class SearchTabResultVC: UIViewController { } override func viewWillAppear(_ animated: Bool) { + print(self.tabBarController?.viewControllers) + self.tabBarController?.tabBar.isHidden = false searchKeyword = searchTextField.text! pageInstance?.searchKey = searchKeyword setObserving() From 19a309ac72b3136d03900e4de6e36bb6f66a5081 Mon Sep 17 00:00:00 2001 From: seu11ee Date: Fri, 27 Nov 2020 15:09:50 +0900 Subject: [PATCH 04/11] =?UTF-8?q?[fix]=20=EA=B2=80=EC=83=89=EA=B2=B0?= =?UTF-8?q?=EA=B3=BC=EB=B7=B0=20=ED=83=AD=EB=B0=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Storyboard/CuratorTabMain.storyboard | 2 +- .../Resource/Storyboard/MyTab.storyboard | 10 +-- .../Storyboard/SearchTabMain.storyboard | 21 +++-- .../Storyboard/SearchTabResult.storyboard | 89 +++++++++---------- .../Source/VCs/SearchResultCuratorVC.swift | 5 +- .../Source/VCs/SearchResultSentenceVC.swift | 4 +- .../Source/VCs/SearchResultThemeVC.swift | 5 +- .../Mongle/Source/VCs/SearchTabResultVC.swift | 11 +-- .../Source/VCs/UnderTabBarController.swift | 5 +- 9 files changed, 72 insertions(+), 80 deletions(-) diff --git a/Mongle/Mongle/Resource/Storyboard/CuratorTabMain.storyboard b/Mongle/Mongle/Resource/Storyboard/CuratorTabMain.storyboard index e5df312..43c2d3f 100644 --- a/Mongle/Mongle/Resource/Storyboard/CuratorTabMain.storyboard +++ b/Mongle/Mongle/Resource/Storyboard/CuratorTabMain.storyboard @@ -26,7 +26,7 @@ - + diff --git a/Mongle/Mongle/Resource/Storyboard/MyTab.storyboard b/Mongle/Mongle/Resource/Storyboard/MyTab.storyboard index 1d45aea..99db962 100644 --- a/Mongle/Mongle/Resource/Storyboard/MyTab.storyboard +++ b/Mongle/Mongle/Resource/Storyboard/MyTab.storyboard @@ -326,10 +326,10 @@ - + - + - @@ -292,19 +291,19 @@ - + - - + + - + - + - + - +