Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions week5/ImageBoard/ImageBoard/AddAtricleViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ class AddArticleViewController : UIViewController {

@IBAction func setPhotoFromLibrary(_ sender: UITapGestureRecognizer) {

// 메서드 이름은 setPhotoFromLibray 인데, 텍스트 필트를 resign 시키는 기능이 들어있는 것은
// 차후에 예상치 못한 동작들을 유발할 가능성이 있어 보입니다.
// 예제라 크게 문제 없겠지만, 실전이라면 나중에 나 또는 다른사람이 내 코드를 운용할 때 문제가 발생할 여지가 있습니다.
titleField.resignFirstResponder()
let imagePickerController = UIImagePickerController()
imagePickerController.sourceType = .photoLibrary
Expand Down
2 changes: 2 additions & 0 deletions week5/ImageBoard/ImageBoard/SignUpViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ class SignUpViewController : UIViewController {
DispatchQueue.main.async {
switch result {
case .ok :
// viewControllers[0] 보다는 viewControllers.first 사용하기
// 빈 Array일 때 viewControllers[0]은 크래쉬가 날 수 있습니다.
let loginViewControllerVC = self.navigationController?.viewControllers[0] as? LoginViewController
loginViewControllerVC?.signUpSuccess = true
self.signUpSuccess = true
Expand Down