启动项目时没有viewcontroller.swift文件

sea*_*ean 0 xcode ios swift xcode11

我尝试启动该项目并使用 viewcontroller,但我没有看到它。只有 appdelegate 和 Scenedelegate 和 contentview。下面的代码应该添加到 viewcontroller 但我不知道在哪里添加。它不断给我一条错误消息,说存在未解析的标识符和操作。请帮忙。

    @IBAction func hello() {
        // add alert

        let alert = UIAlertController(title: "hello", message: "daaaammmmmn", preferredStyle: .alert)
        let okAction = UIAlertAction(title: "ok", style: .default, handler: nil)
        alert.addAction(action)

        present(alert, animated: true, completion: nil)

}
Run Code Online (Sandbox Code Playgroud)

mat*_*att 12

创建项目时,在用户界面弹出窗口中,您选择了 SwiftUI。

在此处输入图片说明

改为选择故事板。

在此处输入图片说明