Skip to content

Commit

Permalink
[Refactor] #239 - Not using delegate functions
Browse files Browse the repository at this point in the history
  • Loading branch information
mini-min committed Jan 19, 2025
1 parent b0c05f5 commit bb5865a
Showing 1 changed file with 1 addition and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ protocol SaveLinkButtonDelegate: AnyObject {
func cancelLinkButtonTapped()
}

protocol AddLinkViewControllerPopDelegate: AnyObject {
func changeTabBarIndex()
}

protocol SelectClipViewControllerDelegate: AnyObject {
func sendEmbedUrl()
}
Expand All @@ -35,7 +31,7 @@ final class AddLinkViewController: UIViewController {

private var isNavigationBarHidden: Bool

private weak var delegate: AddLinkViewControllerPopDelegate?
// private weak var delegate: AddLinkViewControllerPopDelegate?
private weak var urldelegate: SelectClipViewControllerDelegate?

private var addLinkView = AddLinkView()
Expand Down Expand Up @@ -78,10 +74,6 @@ final class AddLinkViewController: UIViewController {
// MARK: - extension

extension AddLinkViewController {
func setupDelegate(forDelegate: AddLinkViewControllerPopDelegate) {
delegate = forDelegate
}

/// 클립보드 붙여넣기 Alert -> 붙여넣기 허용 클릭 후 자동 링크 임베드를 위한 함수
func embedURL(url: String) {
addLinkView.linkEmbedTextField.becomeFirstResponder()
Expand Down Expand Up @@ -137,18 +129,12 @@ private extension AddLinkViewController {
}

func rightButtonTapped() {
delegate?.changeTabBarIndex()
onPopToRoot?()
}

@objc func tappedNextBottomButton() {
onLinkInputCompleted?(addLinkView.linkEmbedTextField.text ?? "")
// let selectClipViewController = ViewControllerFactory.shared.makeSelectClipVC(isNavigationBarHidden: true)
// selectClipViewController.linkURL = addLinkView.linkEmbedTextField.text ?? ""
// selectClipViewController.delegate = self 외부 입력 관련인 것으로 추측
// self.navigationController?.pushViewController(selectClipViewController, animated: true)
}

}

extension AddLinkViewController {
Expand Down Expand Up @@ -193,13 +179,3 @@ extension AddLinkViewController {
.store(in: cancelBag)
}
}

extension AddLinkViewController: SaveLinkButtonDelegate {
func saveLinkButtonTapped() {
delegate?.changeTabBarIndex()
}

func cancelLinkButtonTapped() {
delegate?.changeTabBarIndex()
}
}

0 comments on commit bb5865a

Please sign in to comment.