Skip to content

[진영] 각 게임들의 시작 화면 뷰 컨트롤러를 하나로 통일할 필요성 #7

@Rob-Yoo

Description

@Rob-Yoo
func pushNextVCFromMainVC(nextVC vc: UIViewController, mainVC: UIViewController, idx: Int) {
    var targetVC: UIViewController

    switch idx {
//    case 0:
//        탭탭
//        break
//    case 1:
//        쉐킷쉐킷
//        break
    case 2:
        let nextVC = vc as! BBStartingViewController
        nextVC.delegate = mainVC as? AudioPlayerDelegate
        targetVC = nextVC
        break
//    case 3:
//        더하기 게임
//        break
//    case 4:
//        구구단 게임
//        break
    default:
        return
    }
    mainVC.navigationController?.pushViewController(targetVC, animated: true)
}

각 게임마다 시작 화면 뷰 컨트롤러가 다르면 분기 나눠서 일일히 다운캐스팅 해야하는 하드코딩 이슈 발생. 모든 게임의 시작 화면 뷰 컨트롤러를 하나로 통일하려면 게임 버튼 위의 이미지 크기가 다 동일해야한다.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions