Skip to content

Commit

Permalink
♻️ Refactor: final 키워드 추가, shared 네이밍 수정, 프로토콜 익스텐션으로 분리
Browse files Browse the repository at this point in the history
  • Loading branch information
anyukyung committed Nov 15, 2023
1 parent c534805 commit 79a2547
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
27 changes: 14 additions & 13 deletions iOS/Layover/Layover/Scenes/SignUpViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ protocol SignUpDisplayLogic: AnyObject {
func displayNickanmeDuplication()
}

final class SignUpViewController: UIViewController, SignUpDisplayLogic {

final class SignUpViewController: UIViewController {
// MARK: - UI Components

private let titleLabel: UILabel = {
Expand Down Expand Up @@ -60,7 +60,7 @@ final class SignUpViewController: UIViewController, SignUpDisplayLogic {

override func viewDidLoad() {
super.viewDidLoad()
SignUpConfigurator.sharedInstance.configure(self)
SignUpConfigurator.shared.configure(self)
setUI()

// TODO: Base ViewController 로직으로 분리
Expand Down Expand Up @@ -104,16 +104,6 @@ final class SignUpViewController: UIViewController, SignUpDisplayLogic {

// MARK: - Custom Method

func displayNicknameValidation(response: SignUpModels.ValidateNickname.ViewModel) {
nicknameAlertLabel.isHidden = response.canCheckDuplication
checkDuplicateNicknameButton.isEnabled = response.canCheckDuplication
nicknameAlertLabel.text = response.alertDescription
}

func displayNickanmeDuplication() {

}

private func addTapGesture() {
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(hideKeyboard(_:)))
view.addGestureRecognizer(tapGesture)
Expand All @@ -127,5 +117,16 @@ final class SignUpViewController: UIViewController, SignUpDisplayLogic {
@objc private func hideKeyboard(_ sender: Any) {
view.endEditing(true)
}
}

extension SignUpViewController: SignUpDisplayLogic {
func displayNicknameValidation(response: SignUpModels.ValidateNickname.ViewModel) {
nicknameAlertLabel.isHidden = response.canCheckDuplication
checkDuplicateNicknameButton.isEnabled = response.canCheckDuplication
nicknameAlertLabel.text = response.alertDescription
}

func displayNickanmeDuplication() {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Foundation
final class SignUpConfigurator: Configurator {
typealias T = SignUpViewController

static let sharedInstance = SignUpConfigurator()
static let shared = SignUpConfigurator()

private init() { }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ protocol SignUpBusinessLogic {

protocol SignUpDataStore { }

class SignUpInteractor: SignUpBusinessLogic, SignUpDataStore {
final class SignUpInteractor: SignUpBusinessLogic, SignUpDataStore {

// MARK: - Properties

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ protocol SignUpPresentationLogic {
func presentNicknameValidation(with response: SignUpModels.ValidateNickname.Response)
}

class SignUpPresenter: SignUpPresentationLogic {
final class SignUpPresenter: SignUpPresentationLogic {

// MARK: - Properties

Expand Down

0 comments on commit 79a2547

Please sign in to comment.