纯代码开始项目 不用main.stroyboard

2019-04-22  本文已影响0人  子非鱼7868

挺久没有写ios的代码,今天想写个demo练练手,一开始我就纯代码的写了window 把main interface的main删除了 结果跑不起啦!!!这里记录一下

删除main interface的main

Snip20190417_2.png

删除main.storyboard

Snip20190417_3.png

AppDelegate 添加代码

Snip20190417_4.png
       window = UIWindow(frame: UIScreen.main.bounds)
       window?.rootViewController = ViewController()
       window?.backgroundColor = UIColor.white
       window?.makeKeyAndVisible()
上一篇下一篇

猜你喜欢

热点阅读