Storyboard 雖然很方便使用,但是有幾個問題:
- 多人開發時的「版本控制」問題
- 「客製化元件」使用
- 「AutoLayout」 的處理
所以還是有很多人一看到 Storyboard 就非常反感,以下是如何在 Swift Project 中不使用 Storyboard 的步驟:
Step1: Init Single View Application
Step2: Delete Main.storyboard and ViewController.swift
Step3: Change Main Interface
Step4 : Rewrite AppDelegate.swift