- Swift (iOS App)
使用Swift和Xcode创建一个简单的iOS App,可以在AppDelegate或ViewController中添加以下代码:
swift
import UIKit
@UIApplicationMain zgshgys3w.com
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
// ... 其他代码 ...
}
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
let label = UILabel()
label.text = "Hello, Swift!"
label.frame = CGRect(x: 50, y: 100, width: 200, height: