-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Chore] #141 - 자잘한 수정 사항 #143
The head ref may contain hidden characters: "chore/#141-\uC790\uC798\uD55C-\uC218\uC815-\uC0AC\uD56D"
[Chore] #141 - 자잘한 수정 사항 #143
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수고하셨습니다~~!!👍
이번 기회에 클로저와 Delegate에 대해 조금씩이라도 더 이해해보면 좋을거 같아요!
} else { | ||
// 수정이 된 상태라면 팝업을 띄워주기 | ||
self.navibar.resetLeftButtonAction({ [weak self] in | ||
self?.navibar.leftButton.addTarget(self, action: #selector(self?.presentToQuitEditAlertVC), for: .touchUpInside) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resetLeftButtonAction을 사용하는 방식으로 수정하셨군요!
혹시 여기서 157줄에서 addTarget을 하지 않고 바로
presentToQuitEditAlertVC()
로 적으면 원하는대로 동작을 안 할까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오!! 돼요! 근데 왜 addTarget을 하지 않아도 동작을 하는지 궁금합니다...!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resetLeftButtonAction
함수 내부를 보시면 addTarget하는 함수가 이미 들어가 있습니다!
즉, resetLeftButtonAction는 파라미터로 받은 클로저를 자신의 프로퍼티인 leftButtonClosure에 담고 새로 addTarget을 실행해서 새로 담긴 leftButtonClosure (우리가 파라미터로 넣은 클로저)를 버튼 터치 액션으로 지정해주고 있습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
와우 그랬군요... 코드를 더 살펴봤어야 햇네욥.. 감사합니다!
self.navibar.resetLeftButtonAction({ [weak self] in | ||
self?.navigationController?.popViewController(animated: true) | ||
}, .titleWithLeftButton) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍👍
import UIKit | ||
|
||
import Then | ||
|
||
final class InfoView: UIView { | ||
|
||
// MARK: - initialization | ||
|
||
init() { | ||
super.init(frame: .zero) | ||
self.setUI() | ||
self.setLayout() | ||
self.setDelegate() | ||
self.register() | ||
} | ||
|
||
required init?(coder: NSCoder) { | ||
fatalError("init(coder:) has not been implemented") | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 파일은 어떤 뷰일까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
실수입니다... 삭제할게요 ㅋ
import Foundation | ||
import UIKit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import UIKit을 했으면 Foundation은 따로 import 해주지 않아도 됩니다!
🌱 작업한 내용
🌱 PR Point
📸 스크린샷
생략
📮 관련 이슈