Skip to content

Commit

Permalink
[feat] Add navigationBarButtonItems
Browse files Browse the repository at this point in the history
  • Loading branch information
jihyeep committed May 24, 2024
1 parent 331e160 commit 34c93e6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 14 additions & 1 deletion ToDoList-UIKit/AddToDoViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,20 @@ class AddToDoViewController: UIViewController {
super.viewDidLoad()

self.view.backgroundColor = .white
self.navigationItem.title = "Add ToDo"

let cancelButton = UIBarButtonItem(barButtonSystemItem: .cancel, target: self, action: #selector(cancelButtonTapped))
self.navigationItem.leftBarButtonItem = cancelButton

let doneButton = UIBarButtonItem(barButtonSystemItem: .done, target: self, action: #selector(doneButtonTapped))
self.navigationItem.rightBarButtonItem = doneButton
}


@objc func cancelButtonTapped() {

}

@objc func doneButtonTapped() {

}
}
2 changes: 1 addition & 1 deletion ToDoList-UIKit/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ViewController: UIViewController {

@objc func addButtonTapped() {
let addToDoController = AddToDoViewController()
self.present(addToDoController, animated: true)
self.show(addToDoController, sender: nil)
}


Expand Down

0 comments on commit 34c93e6

Please sign in to comment.