📄 Fileprivate 란?
처음 보는 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