diff --git a/Darner-dan-uh/Darner-dan-uh.xcodeproj/project.pbxproj b/Darner-dan-uh/Darner-dan-uh.xcodeproj/project.pbxproj index 6ec89e4..dc919d6 100644 --- a/Darner-dan-uh/Darner-dan-uh.xcodeproj/project.pbxproj +++ b/Darner-dan-uh/Darner-dan-uh.xcodeproj/project.pbxproj @@ -10,8 +10,16 @@ 9F2CE42D25674F600024FD12 /* RankingModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F2CE42C25674F600024FD12 /* RankingModel.swift */; }; 9F5765482577360A003B37BA /* Mypage.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9F5765472577360A003B37BA /* Mypage.storyboard */; }; 9FC343302566BA54003AEE58 /* RankingViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FC3432F2566BA54003AEE58 /* RankingViewModel.swift */; }; + 9FC7CC91257E1CE000412C16 /* StackViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FC7CC90257E1CE000412C16 /* StackViewController.swift */; }; + 9FC7CC94257E47FE00412C16 /* MemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FC7CC93257E47FE00412C16 /* MemoViewController.swift */; }; + 9FC7CC99257E5CA900412C16 /* MemoTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FC7CC98257E5CA900412C16 /* MemoTableViewCell.swift */; }; + 9FC7CC9D257E681400412C16 /* MemoModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FC7CC9C257E681400412C16 /* MemoModel.swift */; }; 9FCC818A25772C6B0010123B /* SeeMypageViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FCC818925772C6B0010123B /* SeeMypageViewModel.swift */; }; +<<<<<<< Updated upstream D620C5372582587800AA628B /* CharacterCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D620C5362582587800AA628B /* CharacterCollectionViewCell.swift */; }; +======= + 9FE5E5482582566B008D2255 /* DetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FE5E5472582566B008D2255 /* DetailViewController.swift */; }; +>>>>>>> Stashed changes D63FE3212535EF4600DCD75F /* BinggraeMelona-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = D63FE31F2535EF4500DCD75F /* BinggraeMelona-Bold.ttf */; }; D63FE3222535EF4600DCD75F /* BinggraeMelona.ttf in Resources */ = {isa = PBXBuildFile; fileRef = D63FE3202535EF4500DCD75F /* BinggraeMelona.ttf */; }; D644AC8825700665002905AE /* CheckCertificationNumberViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = D644AC8725700665002905AE /* CheckCertificationNumberViewModel.swift */; }; @@ -73,8 +81,16 @@ 9F2CE42C25674F600024FD12 /* RankingModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RankingModel.swift; sourceTree = ""; }; 9F5765472577360A003B37BA /* Mypage.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Mypage.storyboard; sourceTree = ""; }; 9FC3432F2566BA54003AEE58 /* RankingViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RankingViewModel.swift; sourceTree = ""; }; + 9FC7CC90257E1CE000412C16 /* StackViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StackViewController.swift; sourceTree = ""; }; + 9FC7CC93257E47FE00412C16 /* MemoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemoViewController.swift; sourceTree = ""; }; + 9FC7CC98257E5CA900412C16 /* MemoTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemoTableViewCell.swift; sourceTree = ""; }; + 9FC7CC9C257E681400412C16 /* MemoModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MemoModel.swift; sourceTree = ""; }; 9FCC818925772C6B0010123B /* SeeMypageViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SeeMypageViewModel.swift; sourceTree = ""; }; +<<<<<<< Updated upstream D620C5362582587800AA628B /* CharacterCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CharacterCollectionViewCell.swift; sourceTree = ""; }; +======= + 9FE5E5472582566B008D2255 /* DetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DetailViewController.swift; sourceTree = ""; }; +>>>>>>> Stashed changes D63FE31F2535EF4500DCD75F /* BinggraeMelona-Bold.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "BinggraeMelona-Bold.ttf"; sourceTree = ""; }; D63FE3202535EF4500DCD75F /* BinggraeMelona.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = BinggraeMelona.ttf; sourceTree = ""; }; D644AC8725700665002905AE /* CheckCertificationNumberViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CheckCertificationNumberViewModel.swift; sourceTree = ""; }; @@ -159,6 +175,14 @@ path = Cell; sourceTree = ""; }; + 9FC7CC97257E5C8500412C16 /* Cell */ = { + isa = PBXGroup; + children = ( + 9FC7CC98257E5CA900412C16 /* MemoTableViewCell.swift */, + ); + path = Cell; + sourceTree = ""; + }; A2011636CCE48406938D6CA0 /* Frameworks */ = { isa = PBXGroup; children = ( @@ -318,7 +342,11 @@ children = ( 9FC3431925668426003AEE58 /* Cell */, D6A6E26B2563561300A77E05 /* RankingViewController.swift */, +<<<<<<< Updated upstream D660A21D257DA10600C5FE6F /* StackViewController.swift */, +======= + 9FC7CC90257E1CE000412C16 /* StackViewController.swift */, +>>>>>>> Stashed changes ); path = Ranking; sourceTree = ""; @@ -348,7 +376,10 @@ D6BB3744255D1BF30049BB65 /* Writing */ = { isa = PBXGroup; children = ( + 9FC7CC97257E5C8500412C16 /* Cell */, D6A6E266256355D900A77E05 /* WritingViewController.swift */, + 9FC7CC93257E47FE00412C16 /* MemoViewController.swift */, + 9FE5E5472582566B008D2255 /* DetailViewController.swift */, ); path = Writing; sourceTree = ""; @@ -359,6 +390,7 @@ D660A211257DA01F00C5FE6F /* LevelModel.swift */, D660A214257DA03900C5FE6F /* TestResultModel.swift */, 9F2CE42C25674F600024FD12 /* RankingModel.swift */, + 9FC7CC9C257E681400412C16 /* MemoModel.swift */, ); path = Model; sourceTree = ""; @@ -523,8 +555,12 @@ D6A6E12025634B6400A77E05 /* UIViewController.swift in Sources */, D6A6E23C2563544F00A77E05 /* RegisterViewModel.swift in Sources */, 9F2CE42D25674F600024FD12 /* RankingModel.swift in Sources */, +<<<<<<< Updated upstream D660A21E257DA10600C5FE6F /* StackViewController.swift in Sources */, D660A21A257DA0D700C5FE6F /* RankingCell.swift in Sources */, +======= + 9FC7CC9D257E681400412C16 /* MemoModel.swift in Sources */, +>>>>>>> Stashed changes D6A6E22F2563541E00A77E05 /* EnterPwViewController.swift in Sources */, D6A6E22E2563541E00A77E05 /* SetMainCharacterViewController.swift in Sources */, D6A6E11D25634B6400A77E05 /* ViewControllerName.swift in Sources */, @@ -543,8 +579,10 @@ D6A6E25D2563557600A77E05 /* MemorizationViewController.swift in Sources */, D6A6E2302563541E00A77E05 /* CharacterCollectionViewController.swift in Sources */, D6A6E2472563554D00A77E05 /* CheckCertificationNumberViewController.swift in Sources */, + 9FC7CC94257E47FE00412C16 /* MemoViewController.swift in Sources */, D6578ACB2500867A000185F1 /* AppDelegate.swift in Sources */, 9FC343302566BA54003AEE58 /* RankingViewModel.swift in Sources */, + 9FE5E5482582566B008D2255 /* DetailViewController.swift in Sources */, D6A6E26C2563561300A77E05 /* RankingViewController.swift in Sources */, D6A6E23A2563544F00A77E05 /* MypageViewModel.swift in Sources */, D644AC9225700B21002905AE /* TokenMessageModel.swift in Sources */, @@ -558,11 +596,16 @@ D6A6E11E25634B6400A77E05 /* UIColor.swift in Sources */, D6A6E2312563541E00A77E05 /* ModifyViewController.swift in Sources */, D6A6E25A2563557600A77E05 /* TestViewController.swift in Sources */, +<<<<<<< Updated upstream D644AC9E257011FF002905AE /* MessageModel.swift in Sources */, +======= + 9FC7CC99257E5CA900412C16 /* MemoTableViewCell.swift in Sources */, +>>>>>>> Stashed changes D6A6E2572563557600A77E05 /* SelectWordNumViewController.swift in Sources */, D6A6E23B2563544F00A77E05 /* ViewModelType.swift in Sources */, D644AC8825700665002905AE /* CheckCertificationNumberViewModel.swift in Sources */, D6A6E267256355D900A77E05 /* WritingViewController.swift in Sources */, + 9FC7CC91257E1CE000412C16 /* StackViewController.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Darner-dan-uh/Darner-dan-uh.xcworkspace/xcuserdata/munjisu.xcuserdatad/UserInterfaceState.xcuserstate b/Darner-dan-uh/Darner-dan-uh.xcworkspace/xcuserdata/munjisu.xcuserdatad/UserInterfaceState.xcuserstate index f87fa45..9d4b26e 100644 Binary files a/Darner-dan-uh/Darner-dan-uh.xcworkspace/xcuserdata/munjisu.xcuserdatad/UserInterfaceState.xcuserstate and b/Darner-dan-uh/Darner-dan-uh.xcworkspace/xcuserdata/munjisu.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Darner-dan-uh/Darner-dan-uh.xcworkspace/xcuserdata/munjisu.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/Darner-dan-uh/Darner-dan-uh.xcworkspace/xcuserdata/munjisu.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index 3c6cd4c..81a27da 100644 --- a/Darner-dan-uh/Darner-dan-uh.xcworkspace/xcuserdata/munjisu.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/Darner-dan-uh/Darner-dan-uh.xcworkspace/xcuserdata/munjisu.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -107,12 +107,60 @@ filePath = "Darner-dan-uh/Source/NetWorking/DarnerAPI.swift" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "122" - endingLineNumber = "122" + startingLineNumber = "126" + endingLineNumber = "126" landmarkName = "parameter" landmarkType = "24"> >>>>>>> MypageNetworking + + + + + + + + + + + + diff --git a/Darner-dan-uh/Darner-dan-uh/Source/Base/Mypage.storyboard b/Darner-dan-uh/Darner-dan-uh/Source/Base/Mypage.storyboard index 5a8527b..4f69b62 100644 --- a/Darner-dan-uh/Darner-dan-uh/Source/Base/Mypage.storyboard +++ b/Darner-dan-uh/Darner-dan-uh/Source/Base/Mypage.storyboard @@ -68,7 +68,7 @@ - + + + + + + + + + + + + - - - + - diff --git a/Darner-dan-uh/Darner-dan-uh/Source/Base/Ranking.storyboard b/Darner-dan-uh/Darner-dan-uh/Source/Base/Ranking.storyboard index 1c52be3..3bb4052 100644 --- a/Darner-dan-uh/Darner-dan-uh/Source/Base/Ranking.storyboard +++ b/Darner-dan-uh/Darner-dan-uh/Source/Base/Ranking.storyboard @@ -17,8 +17,15 @@ + + + + + + + + - + + + + @@ -92,11 +114,11 @@ - + - - - - - - - - - + + + + + + + @@ -128,24 +148,64 @@ + + - + - + + + + + + + + @@ -188,128 +256,39 @@ - + + - - - + + + - - - + + + - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Darner-dan-uh/Darner-dan-uh/Source/Base/Writing.storyboard b/Darner-dan-uh/Darner-dan-uh/Source/Base/Writing.storyboard index c80fa22..fdc04d6 100644 --- a/Darner-dan-uh/Darner-dan-uh/Source/Base/Writing.storyboard +++ b/Darner-dan-uh/Darner-dan-uh/Source/Base/Writing.storyboard @@ -1,43 +1,287 @@ - + - + - + - + - + + + + + + + + + - + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Darner-dan-uh/Darner-dan-uh/Source/Model/MemoModel.swift b/Darner-dan-uh/Darner-dan-uh/Source/Model/MemoModel.swift new file mode 100644 index 0000000..a443176 --- /dev/null +++ b/Darner-dan-uh/Darner-dan-uh/Source/Model/MemoModel.swift @@ -0,0 +1,23 @@ +// +// MemoModel.swift +// Darner-dan-uh +// +// Created by 문지수 on 2020/12/07. +// Copyright © 2020 이현욱. All rights reserved. +// + +import Foundation + +class MemoModel: Codable { + let content: String + + + init(content: String) { + self.content = content + } + + static var dummyDataList = [ + MemoModel(content: "DarnerDanuh"), + MemoModel(content: "Daaaarneeeer") + ] +} diff --git a/Darner-dan-uh/Darner-dan-uh/Source/Model/RankingModel.swift b/Darner-dan-uh/Darner-dan-uh/Source/Model/RankingModel.swift index 9f1073a..44984c8 100644 --- a/Darner-dan-uh/Darner-dan-uh/Source/Model/RankingModel.swift +++ b/Darner-dan-uh/Darner-dan-uh/Source/Model/RankingModel.swift @@ -8,7 +8,6 @@ import Foundation - struct RankingModel: Codable { let rank: Int let name: String @@ -21,13 +20,5 @@ struct myRankingModel: Codable { let rank: Int? let message: String? let ranking: String? - -// enum CodingKeys: String, CodingKey { -// case rank -// } -// init(from decoder: Decoder) throws { -// let values = try decoder.container(keyedBy: CodingKeys.self) -// rank = try values.decode(String.self, forKey: .rank) -// } -} +} diff --git a/Darner-dan-uh/Darner-dan-uh/Source/Modules/MyPage/EnterPwViewController.swift b/Darner-dan-uh/Darner-dan-uh/Source/Modules/MyPage/EnterPwViewController.swift index 901ccfe..b635abf 100644 --- a/Darner-dan-uh/Darner-dan-uh/Source/Modules/MyPage/EnterPwViewController.swift +++ b/Darner-dan-uh/Darner-dan-uh/Source/Modules/MyPage/EnterPwViewController.swift @@ -18,9 +18,9 @@ class EnterPwViewController: UIViewController { @IBOutlet weak var passwordLbl: UILabel! @IBOutlet weak var passwordTxtField: UITextField! @IBOutlet weak var nextBtn: UIButton! + @IBOutlet weak var cancleBtn: UIBarButtonItem! private let disposeBag = DisposeBag() - // private let viewModel = MypageViewModel() override func viewDidLoad() { super.viewDidLoad() @@ -32,23 +32,49 @@ class EnterPwViewController: UIViewController { passwordTxtField.underLine() password() -// let alret = UIAlertController(title: "비밀번호 확인이 되었습니다!", message: "", preferredStyle: UIAlertController.Style.alert) -// alret.addAction(UIAlertAction(title: "다음", style: .default, handler: nil)) -// present(alret, animated: true, completion: nil) + self.bindAction() } func password() { nextBtn.rx.tap - .map{ self.passwordTxtField.text! } + .map{ self.passwordTxtField.text!} .map { DarnerAPI.verifyPassword(pw: $0)} .flatMap {request -> Observable in return DarnerAPIClient.shared.networkingResult(from: request) }.subscribe { model in - //print(model) self.passwordTxtField.text = model.password }.disposed(by: disposeBag) } + + func bindAction() { + nextBtn.rx.tap + .subscribe({ _ in + self.nextModal(indentifier: "modify") + }).disposed(by: disposeBag) + +// cancleBtn.rx.tap +// .subscribe(onNext: { _ in +// self.backView(identifire: "mypage") +// }).disposed(by: disposeBag) + + + } + + +} + +extension UIViewController { + func nextView(identifier: String) { + let viewController = self.storyboard?.instantiateViewController(identifier: identifier) + navigationController?.pushViewController(viewController!, animated: true) + } + + func nextModal(indentifier: String) { + let viewController = self.storyboard?.instantiateViewController(identifier: indentifier) + viewController?.modalPresentationStyle = .fullScreen + present(viewController!, animated: true, completion: nil) + } } diff --git a/Darner-dan-uh/Darner-dan-uh/Source/Modules/MyPage/ModifyViewController.swift b/Darner-dan-uh/Darner-dan-uh/Source/Modules/MyPage/ModifyViewController.swift index 0d6e216..5b10c9e 100644 --- a/Darner-dan-uh/Darner-dan-uh/Source/Modules/MyPage/ModifyViewController.swift +++ b/Darner-dan-uh/Darner-dan-uh/Source/Modules/MyPage/ModifyViewController.swift @@ -35,6 +35,8 @@ class ModifyViewController: UIViewController { nickNameTxtField.underLine() viewProfile() + modifyProfile() + bindAction() } func viewProfile() { @@ -57,28 +59,16 @@ class ModifyViewController: UIViewController { }).disposed(by: self.disposeBag) }).disposed(by: disposeBag) - -// -// mypage.subscribe { (b) in -// if b.code == 200 { -// -// } -// } onError: { (<#Error#>) in -// <#code#> -// } -// + } - - - - func bindAction() { - //modifyBtn.rx.tap. + modifyBtn.rx.tap + .subscribe(onNext: { _ in + self.presentAlert(message: "", title: "회원정보 수정완료", actionStyle: .default, handler: nil) + }).disposed(by: disposeBag) } - - - + struct a: Codable { let code: Int let name: String @@ -92,6 +82,7 @@ extension UITextField { border.borderColor = UIColor.customGray.cgColor border.frame = CGRect(x: 0, y: self.frame.size.height - width, width: self.frame.size.width, height: self.frame.size.height) border.borderWidth = width + border.borderColor = UIColor.black.cgColor self.layer.addSublayer(border) self.layer.masksToBounds = true } @@ -113,3 +104,5 @@ extension UIButton { + + diff --git a/Darner-dan-uh/Darner-dan-uh/Source/Modules/MyPage/MypageViewController.swift b/Darner-dan-uh/Darner-dan-uh/Source/Modules/MyPage/MypageViewController.swift index 8229f45..745a2ab 100644 --- a/Darner-dan-uh/Darner-dan-uh/Source/Modules/MyPage/MypageViewController.swift +++ b/Darner-dan-uh/Darner-dan-uh/Source/Modules/MyPage/MypageViewController.swift @@ -29,8 +29,10 @@ class MypageViewController: UIViewController { characterBtn.buttonStyle() modifyBtn.buttonStyle() + } - + + } diff --git a/Darner-dan-uh/Darner-dan-uh/Source/Modules/Ranking/RankingViewController.swift b/Darner-dan-uh/Darner-dan-uh/Source/Modules/Ranking/RankingViewController.swift index c476d1b..ade309b 100644 --- a/Darner-dan-uh/Darner-dan-uh/Source/Modules/Ranking/RankingViewController.swift +++ b/Darner-dan-uh/Darner-dan-uh/Source/Modules/Ranking/RankingViewController.swift @@ -19,7 +19,7 @@ final class RankingViewController: UIViewController { @IBOutlet weak var myRankingLbl: UILabel! @IBOutlet weak var myRankingView: UIView! @IBOutlet weak var myRanknumLbl: UILabel! - @IBOutlet weak var myNickName: UILabel! + @IBOutlet weak var myNameLbl: UILabel! @IBOutlet weak var tableView: UITableView! private let disposeBag = DisposeBag() @@ -39,22 +39,10 @@ final class RankingViewController: UIViewController { rank() myRank() } -// -// func bindViewModel() { -// let input = RankingViewModel.Input(loadData: loadData.asSignal(onErrorJustReturn: ())) -// let output = viewModel.transform(input) -// -// output.loadApplyList.bind(to: tableView.rx.items) { tableView, index, element -> UITableViewCell in -// guard let cell = self.tableView.dequeueReusableCell(withIdentifier: "RankingCell") as? RankingCell else { return RankingCell() } -// cell.RankingData = element -// return cell -// }.disposed(by: disposeBag) -// } override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) - - // self.navigationController?.isNavigationBarHidden = true + self.navigationItem.hidesBackButton = true } func myRank() { @@ -64,13 +52,25 @@ final class RankingViewController: UIViewController { }).disposed(by: disposeBag) } + func myRank() { + let rank: Observable = DarnerAPIClient.shared.networkingResult(from: .myrank("smKim")) + rank.asObservable().subscribe(onNext: { model in + self.myRanknumLbl.text = String(model.rank ?? 2) + }).disposed(by: disposeBag) + } + func rank() { - let rank: Observable = DarnerAPIClient.shared.networkingResult(from: .rank(3)) - rank.map { $0.ranking }.bind(to: tableView.rx.items(cellIdentifier: "rankingCell", cellType: RankingCell.self)) { idx, model, cell in - cell.nickNameLbl?.text = model.name - cell.RankingLbl?.text = String(model.rank ?? 1) - }.disposed(by: disposeBag) + let rank: Observable = DarnerAPIClient.shared.networkingResult(from: .rank(3)) + rank.map { $0.ranking }.bind(to: tableView.rx.items(cellIdentifier: "rankingCell", cellType: RankingCell.self)) { idx, model, cell in + cell.nickNameLbl?.text = model.name + cell.RankingLbl?.text = String(model.rank) + }.disposed(by: disposeBag) + } + + struct a: Codable { + let rank: Int? + let message: String? } private func registerCell() { @@ -104,3 +104,16 @@ extension UIViewController { } +extension UIViewController { + func navigationImage() { + let imageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 40, height: 35)) + imageView.contentMode = .scaleAspectFit + + let image = UIImage(named: "LogoImage") + imageView.image = image + + navigationItem.titleView = imageView + } + +} + diff --git a/Darner-dan-uh/Darner-dan-uh/Source/Modules/Writing/WritingViewController.swift b/Darner-dan-uh/Darner-dan-uh/Source/Modules/Writing/WritingViewController.swift index 41e217d..e190ed0 100644 --- a/Darner-dan-uh/Darner-dan-uh/Source/Modules/Writing/WritingViewController.swift +++ b/Darner-dan-uh/Darner-dan-uh/Source/Modules/Writing/WritingViewController.swift @@ -5,18 +5,82 @@ // Created by 이현욱 on 2020/09/03. // Copyright © 2020 이현욱. All rights reserved. // - import UIKit -final class WritingViewController: UIViewController { +import RxSwift +import RxCocoa +class WritingViewController: UIViewController { + + @IBOutlet weak var saveBtn: UIBarButtonItem! + @IBOutlet weak var titleTxtField: UITextField! + @IBOutlet weak var writingTxtView: UITextView! + + private let disposeBag = DisposeBag() + var dummyData = [String]() + override func viewDidLoad() { super.viewDidLoad() - // Do any additional setup after loading the view. + + let memo = UserDefaults.standard.object(forKey: "no") as? Int + + if(memo == -1) { + dummyData = (UserDefaults.standard.object(forKey: "data") as? [String])! + writingTxtView.text = "..."; + + } + + writingTxtView.layer.borderWidth = 2 + writingTxtView.layer.borderColor = UIColor.gray.cgColor + writingTxtView.layer.cornerRadius = 15 + + save(saveBtn) + bindAction() + navigationImage() + } + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + } + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + self.navigationItem.hidesBackButton = false + } + func save(_ button: UIBarButtonItem) { + let memo = UserDefaults.standard.object(forKey: "no") as? Int + + if(memo == -1) { + dummyData.insert(writingTxtView.text, at: 0) + UserDefaults.standard.set(dummyData, forKey: "data") + } + // else { +// dummyData.remove(at: memo?) +// dummyData.insert(writingTxtView.text, at: memo?) +// +// UserDefaults.standard.set(dummyData, forKey: "data") +// } + + print("save") + + dismiss(animated: true, completion: nil) + + } + func bindAction() { + saveBtn.rx.tap + .subscribe(onNext: { _ in + self.backView(identifire: "memo") + }).disposed(by: disposeBag) + } } +extension UIViewController { + func backView(identifire: String) { + navigationController!.popViewController(animated: true) + } +} + + diff --git a/Darner-dan-uh/Darner-dan-uh/Source/NetWorking/DarnerAPI.swift b/Darner-dan-uh/Darner-dan-uh/Source/NetWorking/DarnerAPI.swift index ff77886..08fe14f 100644 --- a/Darner-dan-uh/Darner-dan-uh/Source/NetWorking/DarnerAPI.swift +++ b/Darner-dan-uh/Darner-dan-uh/Source/NetWorking/DarnerAPI.swift @@ -16,8 +16,8 @@ enum DarnerAPI { case verifywithemail(email: String, code: String) case login(userId: String, password: String) case logout - case rank(_ id: Int) - case myrank(_ count: String) + case rank(_ count: Int) + case myrank(_ id: String) case stack case wordGenre(word_id: String, number: String) case wordTest @@ -110,13 +110,11 @@ extension DarnerAPI { var header: HTTPHeaders? { switch self { - case .wordGenre, - .wordTest, - .savedata, - .getLevel, - .rank: - let token = UserDefaults.standard.value(forKey: "token") as! String - return ["Authorization" : "Bearer " + token] + case .verifywithemail(_, let code): + return ["code" : code] + case .verifyPassword: + return ["Authorization": "Bearer " + "eyJhbGciOiJIUzUxMiJ9.eyJqdGkiOiJzbWtpbSIsImlhdCI6MTYwNzI2MjAzMSwiZXhwIjoxNjA3MjgwMDMxfQ.mlzlDztiWAWUwDXW_7DUN3SA1FRU9khqOcTqfh4lhP5xJV9PxNeLsuU7bdBYjQOQbsAiETzR020Z-44lp8JjIw", + "content-type": "application/json"] default: return ["Content-Type":"application/json"] } diff --git a/Darner-dan-uh/Darner-dan-uh/Source/ViewModel/Modules/Ranking/StackViewController.swift b/Darner-dan-uh/Darner-dan-uh/Source/ViewModel/Modules/Ranking/StackViewController.swift index 9c2a685..39b75cf 100644 --- a/Darner-dan-uh/Darner-dan-uh/Source/ViewModel/Modules/Ranking/StackViewController.swift +++ b/Darner-dan-uh/Darner-dan-uh/Source/ViewModel/Modules/Ranking/StackViewController.swift @@ -2,7 +2,7 @@ // StackViewController.swift // Darner-dan-uh // -// Created by 문지수 on 2020/12/04. +// Created by 문지수 on 2020/12/07. // Copyright © 2020 이현욱. All rights reserved. // @@ -25,7 +25,7 @@ class StackViewController: UIViewController { // Do any additional setup after loading the view. navigationClear() navigationImage() - buttonAction() + //buttonAction() } override func viewWillAppear(_ animated: Bool) { @@ -34,12 +34,29 @@ class StackViewController: UIViewController { } func buttonAction() { - stackBtn.rx.tap + rankingBtn.rx.tap .subscribe{ _ in - self.nextView(identifire: "ranking") + self.nextVC(identifier: "ranking") }.disposed(by: disposeBag) } } + +extension UIViewController { + func navigationClear(){ + let bar:UINavigationBar! = self.navigationController?.navigationBar + bar.setBackgroundImage(UIImage(), for: UIBarMetrics.default) + bar.shadowImage = UIImage() + bar.backgroundColor = UIColor.clear + } + + func nextVC(identifier: String) { + let viewController = self.storyboard?.instantiateViewController(identifier: identifier) + viewController?.modalPresentationStyle = .fullScreen + present(viewController!, animated: false, completion: nil) + + + } +} diff --git a/Darner-dan-uh/Darner-dan-uh/Source/ViewModel/Modules/Writing/Cell/MemoTableViewCell.swift b/Darner-dan-uh/Darner-dan-uh/Source/ViewModel/Modules/Writing/Cell/MemoTableViewCell.swift new file mode 100644 index 0000000..eeed1a9 --- /dev/null +++ b/Darner-dan-uh/Darner-dan-uh/Source/ViewModel/Modules/Writing/Cell/MemoTableViewCell.swift @@ -0,0 +1,26 @@ +// +// MemoTableViewCell.swift +// Darner-dan-uh +// +// Created by 문지수 on 2020/12/07. +// Copyright © 2020 이현욱. All rights reserved. +// + +import UIKit + +class MemoTableViewCell: UITableViewCell { + + @IBOutlet weak var titleLbl: UILabel! + + override func awakeFromNib() { + super.awakeFromNib() + // Initialization code + } + + override func setSelected(_ selected: Bool, animated: Bool) { + super.setSelected(selected, animated: animated) + + // Configure the view for the selected state + } + +} diff --git a/Darner-dan-uh/Darner-dan-uh/Source/ViewModel/Modules/Writing/DetailViewController.swift b/Darner-dan-uh/Darner-dan-uh/Source/ViewModel/Modules/Writing/DetailViewController.swift new file mode 100644 index 0000000..c1962c1 --- /dev/null +++ b/Darner-dan-uh/Darner-dan-uh/Source/ViewModel/Modules/Writing/DetailViewController.swift @@ -0,0 +1,28 @@ +// +// DetailViewController.swift +// Darner-dan-uh +// +// Created by 문지수 on 2020/12/10. +// Copyright © 2020 이현욱. All rights reserved. +// + +import UIKit + +class DetailViewController: UIViewController { + + @IBOutlet weak var txtField: UITextField! + @IBOutlet weak var txtView: UITextView! + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + + txtView.layer.borderColor = UIColor.customGray.cgColor + txtView.layer.borderWidth = 1.5 + txtView.layer.cornerRadius = 20 + } + + + +} diff --git a/Darner-dan-uh/Darner-dan-uh/Source/ViewModel/Modules/Writing/MemoViewController.swift b/Darner-dan-uh/Darner-dan-uh/Source/ViewModel/Modules/Writing/MemoViewController.swift new file mode 100644 index 0000000..8435d14 --- /dev/null +++ b/Darner-dan-uh/Darner-dan-uh/Source/ViewModel/Modules/Writing/MemoViewController.swift @@ -0,0 +1,65 @@ +// +// MemoViewController.swift +// Darner-dan-uh +// +// Created by 문지수 on 2020/12/07. +// Copyright © 2020 이현욱. All rights reserved. +// + +import UIKit + +import RxSwift +import RxCocoa + +class MemoViewController: UIViewController, UITableViewDataSource { + + let disposeBag = DisposeBag() + + @IBOutlet weak var memoView: UIView! + @IBOutlet weak var tableView: UITableView! + @IBOutlet weak var memoLbl: UILabel! + @IBOutlet weak var writeBtn: UIButton! + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view. + + registerCell() + bindAction() + navigationImage() + navigationClear() + + memoView.layer.borderColor = UIColor.black.cgColor + memoView.layer.borderWidth = 1.5 + memoView.layer.cornerRadius = 20 + + + } + + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return MemoModel.dummyDataList.count + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: "memoCell", for: indexPath) + let target = MemoModel.dummyDataList[indexPath.row] + cell.textLabel?.text = target.content + + return cell + } + + func registerCell() { + tableView.rowHeight = 80 + } + + func bindAction() { + writeBtn.rx.tap + .subscribe(onNext: { _ in + self.nextView(identifier: "write") + }).disposed(by: disposeBag) + } + + + + +} diff --git "a/Darner-dan-uh/Darner-dan-uh/Supporting/Assets.xcassets/\353\205\270\353\236\200\354\225\214.imageset/Contents.json" "b/Darner-dan-uh/Darner-dan-uh/Supporting/Assets.xcassets/\353\205\270\353\236\200\354\225\214.imageset/Contents.json" index 884c815..c4088b2 100644 --- "a/Darner-dan-uh/Darner-dan-uh/Supporting/Assets.xcassets/\353\205\270\353\236\200\354\225\214.imageset/Contents.json" +++ "b/Darner-dan-uh/Darner-dan-uh/Supporting/Assets.xcassets/\353\205\270\353\236\200\354\225\214.imageset/Contents.json" @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "스크린샷 2020-10-08 오전 11.15.48.png", + "filename" : "스크린샷 2020-10-08 오전 11.15.48.png", "idiom" : "universal", "scale" : "1x" }, diff --git "a/Darner-dan-uh/Darner-dan-uh/Supporting/Assets.xcassets/\353\241\234\352\263\240&\355\225\221\355\201\254 \353\263\221\354\225\204\353\246\254.imageset/Contents.json" "b/Darner-dan-uh/Darner-dan-uh/Supporting/Assets.xcassets/\353\241\234\352\263\240&\355\225\221\355\201\254 \353\263\221\354\225\204\353\246\254.imageset/Contents.json" index 9e38c47..a84850d 100644 --- "a/Darner-dan-uh/Darner-dan-uh/Supporting/Assets.xcassets/\353\241\234\352\263\240&\355\225\221\355\201\254 \353\263\221\354\225\204\353\246\254.imageset/Contents.json" +++ "b/Darner-dan-uh/Darner-dan-uh/Supporting/Assets.xcassets/\353\241\234\352\263\240&\355\225\221\355\201\254 \353\263\221\354\225\204\353\246\254.imageset/Contents.json" @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "스크린샷 2020-09-25 오전 9.57.56-1.png", + "filename" : "스크린샷 2020-09-25 오전 9.57.56.png", "idiom" : "universal", "scale" : "1x" }, diff --git "a/Darner-dan-uh/Darner-dan-uh/Supporting/Assets.xcassets/\354\212\244\355\203\235.imageset/Contents.json" "b/Darner-dan-uh/Darner-dan-uh/Supporting/Assets.xcassets/\354\212\244\355\203\235.imageset/Contents.json" index 458dfed..2c9759c 100644 --- "a/Darner-dan-uh/Darner-dan-uh/Supporting/Assets.xcassets/\354\212\244\355\203\235.imageset/Contents.json" +++ "b/Darner-dan-uh/Darner-dan-uh/Supporting/Assets.xcassets/\354\212\244\355\203\235.imageset/Contents.json" @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "스크린샷 2020-12-06 오후 2.48.22.png", + "filename" : "스크린샷 2020-12-07 오후 7.26.08.png", "idiom" : "universal", "scale" : "1x" }, diff --git "a/Darner-dan-uh/Darner-dan-uh/Supporting/Assets.xcassets/\354\212\244\355\203\235.imageset/\354\212\244\355\201\254\353\246\260\354\203\267 2020-12-07 \354\230\244\355\233\204 7.26.08.png" "b/Darner-dan-uh/Darner-dan-uh/Supporting/Assets.xcassets/\354\212\244\355\203\235.imageset/\354\212\244\355\201\254\353\246\260\354\203\267 2020-12-07 \354\230\244\355\233\204 7.26.08.png" new file mode 100644 index 0000000..b41141e Binary files /dev/null and "b/Darner-dan-uh/Darner-dan-uh/Supporting/Assets.xcassets/\354\212\244\355\203\235.imageset/\354\212\244\355\201\254\353\246\260\354\203\267 2020-12-07 \354\230\244\355\233\204 7.26.08.png" differ diff --git "a/Darner-dan-uh/Darner-dan-uh/Supporting/Assets.xcassets/\355\214\214\353\236\200 \353\263\221\354\225\204\353\246\254.imageset/Contents.json" "b/Darner-dan-uh/Darner-dan-uh/Supporting/Assets.xcassets/\355\214\214\353\236\200 \353\263\221\354\225\204\353\246\254.imageset/Contents.json" index f2eedb9..2b84201 100644 --- "a/Darner-dan-uh/Darner-dan-uh/Supporting/Assets.xcassets/\355\214\214\353\236\200 \353\263\221\354\225\204\353\246\254.imageset/Contents.json" +++ "b/Darner-dan-uh/Darner-dan-uh/Supporting/Assets.xcassets/\355\214\214\353\236\200 \353\263\221\354\225\204\353\246\254.imageset/Contents.json" @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "스크린샷 2020-10-08 오전 11.15.13-1.png", + "filename" : "스크린샷 2020-10-08 오전 11.15.13.png", "idiom" : "universal", "scale" : "1x" }, diff --git "a/Darner-dan-uh/Darner-dan-uh/Supporting/Assets.xcassets/\355\214\214\353\236\200\354\225\214.imageset/Contents.json" "b/Darner-dan-uh/Darner-dan-uh/Supporting/Assets.xcassets/\355\214\214\353\236\200\354\225\214.imageset/Contents.json" index 3d51b4c..7ad7144 100644 --- "a/Darner-dan-uh/Darner-dan-uh/Supporting/Assets.xcassets/\355\214\214\353\236\200\354\225\214.imageset/Contents.json" +++ "b/Darner-dan-uh/Darner-dan-uh/Supporting/Assets.xcassets/\355\214\214\353\236\200\354\225\214.imageset/Contents.json" @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "스크린샷 2020-10-08 오전 11.15.36.png", + "filename" : "스크린샷 2020-10-08 오전 11.15.36.png", "idiom" : "universal", "scale" : "1x" }, diff --git "a/Darner-dan-uh/Darner-dan-uh/Supporting/Assets.xcassets/\355\225\221\355\201\254\354\225\214.imageset/Contents.json" "b/Darner-dan-uh/Darner-dan-uh/Supporting/Assets.xcassets/\355\225\221\355\201\254\354\225\214.imageset/Contents.json" index 487f237..0678fe8 100644 --- "a/Darner-dan-uh/Darner-dan-uh/Supporting/Assets.xcassets/\355\225\221\355\201\254\354\225\214.imageset/Contents.json" +++ "b/Darner-dan-uh/Darner-dan-uh/Supporting/Assets.xcassets/\355\225\221\355\201\254\354\225\214.imageset/Contents.json" @@ -1,7 +1,7 @@ { "images" : [ { - "filename" : "스크린샷 2020-10-08 오전 11.15.54-1.png", + "filename" : "스크린샷 2020-10-08 오전 11.15.54.png", "idiom" : "universal", "scale" : "1x" },