Xcode StoryBoardなしでコードを記述
以前はStoryboard、Xibを使用していました
最近はコードで画面を整理したいだけです.
コードで書くのも面白いと思います.
まず最初はStoryboardがつながっているはずです
Storyboardを右クリックしてDeleteを行うと、次のウィンドウが表示されます.
「Remove Reference」は現在のプロジェクトでは表示されませんが、ファイルは保存されています.
ムーブトトラッシュでゴミ箱に移動しましょう
次に、プロジェクトのGeneralからMainインタフェースのMainを削除します.
plistファイルでは、上記のアプリケーションScene Mainvestパスを介して
最後のStoryBard名を削除すると、Storyboard接続が切断されます.
コードで接続するので、SceneDelegateに移動してください.
その後、makeKeyAndVisibleメソッドを使用して画面を表示できます.
こんな感じでviewの背景をgrayに設定されたビューコントローラを表示します.
最近はコードで画面を整理したいだけです.
コードで書くのも面白いと思います.
まず最初はStoryboardがつながっているはずです

Storyboardを右クリックしてDeleteを行うと、次のウィンドウが表示されます.

「Remove Reference」は現在のプロジェクトでは表示されませんが、ファイルは保存されています.
ムーブトトラッシュでゴミ箱に移動しましょう

次に、プロジェクトのGeneralからMainインタフェースのMainを削除します.

plistファイルでは、上記のアプリケーションScene Mainvestパスを介して
最後のStoryBard名を削除すると、Storyboard接続が切断されます.
コードで接続するので、SceneDelegateに移動してください.
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
guard let windowScene = (scene as? UIWindowScene) else { return }
window = UIWindow(windowScene: windowScene)
// ViewController 생성
let vc = ViewController()
window?.rootViewController = vc
window?.makeKeyAndVisible()
}
接続するビューアを作成し、ウィンドウに接続するrootViewコントローラ.その後、makeKeyAndVisibleメソッドを使用して画面を表示できます.

こんな感じでviewの背景をgrayに設定されたビューコントローラを表示します.
Reference
この問題について(Xcode StoryBoardなしでコードを記述), 我々は、より多くの情報をここで見つけました https://velog.io/@mytrace/XcodeStoryboard-없이-코드로-작성하기テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol