[Swift] 다른 file (viewController) 간의 조작

2022. 8. 31. 12:58Programming/Swift

 

 

    private var isKorean: Bool = false
    
    func setISKorean(isKoreanBool: Bool) {
        self.isKorean = isKoreanBool
    }​

: Set method

 

 

 

 

    @objc private func englishSettingButtonTapped() {
        let englishTextViewController = EnglishTextViewController()
        englishTextViewController.setISKorean(isKoreanBool: false)
        self.navigationController?.pushViewController(englishTextViewController, animated: true)
    }

viewController에 method로 접근한다.

 

👍