๐Ÿ“„ Fileprivate ๋ž€?

2022. 7. 21. 10:09ใ†Programming/Swift

 

 

์ฒ˜์Œ ๋ณด๋Š” fileprivate ํ‚ค์›Œ๋“œ โœ๏ธ

 

 

 

    private let emailLoginButton: CustomedLoginButton = {
        let button = CustomedLoginButton()
        button.setImage(UIImage(systemName: "envelope.fill"), for: .normal)
        button.tintColor = UIColor.black
        button.backgroundColor = UIColor.white
        button.setTitle("์ด๋ฉ”์ผ๋กœ ๊ฐ€์ž…ํ•˜๊ธฐ", for: .normal)
        button.setTitleColor(UIColor.black, for: .normal)
        button.titleLabel?.font = UIFont.systemFont(ofSize: 22, weight: .semibold)
        button.addTarget(self,
                         action: #selector(goToEmailLoginViewController),
                         for: .touchUpInside)
        return button
    }()

 

 

 

extension SignInViewController {
    @objc fileprivate func goToEmailLoginViewController() {
        let controller = EmailLoginViewController()
        controller.modalPresentationStyle = .fullScreen
        present(controller, animated: false, completion: nil)
     }
}

 

 

 

 

fileprivate is one of the new Swift 3 access modifiers that replaces private in its meaning. fileprivate defines an entity (class, extension, property, ...) as private to everybody outside the source file it is declared in, but accessible to all entities in that source file.

 

Fileprivate access restricts the use of an entity within the same defined source file. The only reason you would use fileprivate is when you want to access your code within the same file from different classes or structs.

 

 

 

 

 

์ถœ์ฒ˜

https://stackoverflow.com/questions/67860652/swift-uikit-navigate-to-starting-view-programmatically

 

Swift Uikit navigate to starting view programmatically

I have an Ios app build with Swift UIKit, where all views are embedded in a bottom navigation within the soryboard. I want to navigate to the home view (starting view) from another view on a button...

stackoverflow.com