Automate iOS build and device installation
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import UIKit
|
||||
|
||||
@main
|
||||
final class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
var window: UIWindow?
|
||||
|
||||
func application(
|
||||
_ application: UIApplication,
|
||||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
|
||||
) -> Bool {
|
||||
let label = UILabel()
|
||||
label.text = "Hello, world!"
|
||||
label.font = .systemFont(ofSize: 32, weight: .bold)
|
||||
label.textAlignment = .center
|
||||
|
||||
let viewController = UIViewController()
|
||||
viewController.view.backgroundColor = .systemBackground
|
||||
viewController.view.addSubview(label)
|
||||
label.translatesAutoresizingMaskIntoConstraints = false
|
||||
NSLayoutConstraint.activate([
|
||||
label.centerXAnchor.constraint(equalTo: viewController.view.centerXAnchor),
|
||||
label.centerYAnchor.constraint(equalTo: viewController.view.centerYAnchor),
|
||||
])
|
||||
|
||||
let window = UIWindow(frame: UIScreen.main.bounds)
|
||||
window.rootViewController = viewController
|
||||
window.makeKeyAndVisible()
|
||||
self.window = window
|
||||
return true
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user