iOS 기본 (swift)
[iOS - swift] AppDelegate 참조 방법
jake-kim
2021. 1. 31. 23:30
- AppDelgate 테스트용 함수
// testPrint()
func testPrint() {
print("Test!!")
}
- AppDelegate 참조
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
if let appDelegate = UIApplication.shared.delegate as? AppDelegate {
appDelegate.testPrint()
}
}
}