Skip to content

Commit

Permalink
#3 add Reservation view navigation title
Browse files Browse the repository at this point in the history
  • Loading branch information
JunseokNoh committed Jul 18, 2021
1 parent e205e38 commit cbc5fcb
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
4 changes: 4 additions & 0 deletions KNU_CSE/KNU_CSE.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
681D37D526A48A6F000D9FE8 /* MyPageModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 681D37D426A48A6F000D9FE8 /* MyPageModel.swift */; };
681D37D726A48B37000D9FE8 /* BoardCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 681D37D626A48B37000D9FE8 /* BoardCell.swift */; };
681D37D926A4A75F000D9FE8 /* ClassDataDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 681D37D826A4A75F000D9FE8 /* ClassDataDelegate.swift */; };
681D37DB26A4AAAC000D9FE8 /* ReservationViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 681D37DA26A4AAAC000D9FE8 /* ReservationViewModel.swift */; };
68F1A5B826A0088B007B4B86 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68F1A5B726A0088B007B4B86 /* AppDelegate.swift */; };
68F1A5BA26A0088B007B4B86 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68F1A5B926A0088B007B4B86 /* SceneDelegate.swift */; };
68F1A5BC26A0088B007B4B86 /* SignInView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 68F1A5BB26A0088B007B4B86 /* SignInView.swift */; };
Expand Down Expand Up @@ -87,6 +88,7 @@
681D37D426A48A6F000D9FE8 /* MyPageModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MyPageModel.swift; sourceTree = "<group>"; };
681D37D626A48B37000D9FE8 /* BoardCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BoardCell.swift; sourceTree = "<group>"; };
681D37D826A4A75F000D9FE8 /* ClassDataDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClassDataDelegate.swift; sourceTree = "<group>"; };
681D37DA26A4AAAC000D9FE8 /* ReservationViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReservationViewModel.swift; sourceTree = "<group>"; };
68F1A5B426A0088B007B4B86 /* KNU_CSE.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = KNU_CSE.app; sourceTree = BUILT_PRODUCTS_DIR; };
68F1A5B726A0088B007B4B86 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
68F1A5B926A0088B007B4B86 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -207,6 +209,7 @@
isa = PBXGroup;
children = (
681D37C926A467CA000D9FE8 /* ReservationView.swift */,
681D37DA26A4AAAC000D9FE8 /* ReservationViewModel.swift */,
);
path = Reservation;
sourceTree = "<group>";
Expand Down Expand Up @@ -681,6 +684,7 @@
68F1A5FC26A01080007B4B86 /* SignInViewModel.swift in Sources */,
68F1A5F926A0090B007B4B86 /* BindingTextField.swift in Sources */,
681D37B526A419F3000D9FE8 /* MyPageView.swift in Sources */,
681D37DB26A4AAAC000D9FE8 /* ReservationViewModel.swift in Sources */,
68F1A60026A07FE7007B4B86 /* CheckBox.swift in Sources */,
68F1A5EC26A008FF007B4B86 /* Request.swift in Sources */,
68F1A5EE26A008FF007B4B86 /* BaseObject.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ import UIKit

class ReservationView : UIViewController, ClassDataDelegate{

var reservationViewModel : ReservationViewModel = ReservationViewModel()

override func viewWillAppear(_ animated: Bool) {
// self.navigationController?.navigationBar.topItem?.title = "강의실 예약"
let backBarButtonItem = UIBarButtonItem(title: "", style: .plain, target: self, action: nil)
self.navigationController?.navigationBar.topItem?.backBarButtonItem = backBarButtonItem
}

override func viewDidLoad() {
initUI()
addView()
setupConstraints()

}

func initUI(){
Expand All @@ -34,6 +36,11 @@ class ReservationView : UIViewController, ClassDataDelegate{
}

func sendData(data: ClassRoom) {
print(data.building, data.roomId)
reservationViewModel.setClassRoom(classRoom: data)
setNavigationTitle(title: "\(data.building)-\(data.roomId)")
}

func setNavigationTitle(title:String){
self.navigationItem.title = title
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// ReservationViewModel.swift
// KNU_CSE
//
// Created by junseok on 2021/07/19.
//

import Foundation

struct ReservationViewModel{
var classRoom : ClassRoom?

mutating func setClassRoom(classRoom:ClassRoom){
self.classRoom = classRoom
}
}

0 comments on commit cbc5fcb

Please sign in to comment.