非常详细的图文入门教程http://www.raywenderlich.com/81879/storyboards-tutorial-swift-part-1

因为太长了 所以只放一些我觉得很有用的内容的翻译

The single View Controller you defined was set as the Initial View Controller – but how did the app load it? Take a peek at the application delegate to find the answer. Open up AppDelegate.swift and you’ll see the source starts with this:

你定义的View Controller被设置为初始视图控制器-但是app是怎么装载的呢?看一眼应用委托来找答案。打开AppDelegate.swift然后你就会发现源代码是这样开始的

import UIKit@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {var window: UIWindow?func application(application: UIApplication!, didFinishLaunchingWithOptions launchOptions: NSDictionary!) -> Bool {// Override point for customization after application launch.return true}

The @UIApplicationMain attribute at the top of the file designates the AppDelegate class as the entry point for the module. It is a requirement for using storyboards that your application delegate inherits from UIResponder and that it has a UIWindow property. All the methods are practically empty. Evenapplication(_:didFinishLaunchingWithOptions:) simply returns true.

文件顶部的@UIApplicationMain 属性指定了AppDelegate 类作为模块的入口。使用你的应用指定从UIResponder继承来有UIWindows属性的storyboards是必须的。所有的方法实际上是空的。甚至 application(_:didFinishLaunchingWithOptions:)也是简单地返回ture值。

The secret is in the Info.plist file. Click on Info.plist (you can find it in the Supporting Files group) and you’ll see this:

秘密藏在Info.plist文件里。点击Info.plist(可以在Supporting Files 分组里) 然后你将会看到这个

Storyboard apps use the key UIMainStoryboardFile, also known as “Main storyboard file base name”, to specify the name of the storyboard that must be loaded when the app starts. When this setting is present, UIApplication will load the named storyboard file, automatically instantiate the “Initial View Controller” from that storyboard, and then put that controller’s view into a new UIWindow object.

Storyboard 应用使用键 UIMainStoryboardFile,也命名为"Main storyboard file base name(主storyboard文件基础名)",规定了应用启动时必须加载的storyboard的名字。当这个设置被呈现的时候,UIApplication将会载入指定的storyboard文件,自动地从那个storyboard实例化"Initial View Controller(初始视图控制器)",然后把那个控制器的视图放入一个新的UIWindows对象。

You can also see this in the Project Settings under the General tab and Deployment Info section:

你也可以在项目设置中的General 表单Deployment Info 部分看到这个

Now to create the real Ratings app with several view controllers.

转载于:https://www.cnblogs.com/baaingSheep/p/4280523.html

[raywenderlich教程]相关推荐

  1. Unity 4.3 2D 教程:新手上路

    这篇文章译自 Christopher LaPollo 先生的 Unity 4.3 2D 教程的第一部分 Unity 4.3 2D Tutorial: Getting Started 感谢这套优秀教程的 ...

  2. (译)cocos2d-x跨androidios平台开发入门教程

    免责申明(必读!):本博客提供的所有教程的翻译原稿均来自于互联网,仅供学习交流之用,切勿进行商业传播.同时,转载时不要移除本申明.如产生任何纠纷,均与本博客所有人.发表该翻译稿之人无任何关系.谢谢合作 ...

  3. Swift语言中如何使用JSON数据教程

    原文:Swift语言中如何使用JSON数据教程 这是一篇翻译文章,原文出处:http://www.raywenderlich.com/82706/working-with-json-in-swift- ...

  4. [译] NSCollectionView 入门教程

    本文翻译自 raywenderlich.com 的 NSCollectionView Tutorial,已咨询对方网站,可至多翻译 10 篇文章. 希望各位有英语阅读能力的话,还是 先打赏 然后去阅读 ...

  5. PaintCode 教程1:动态绘制按钮

    2019独角兽企业重金招聘Python工程师标准>>> PaintCode 是一个能够让你像Photoshop一样去设计你的用户界面的软件 – 但是它并不是仅仅保存一张图片当作资源让 ...

  6. iOS游戏开发教程资源

    转载自 http://www.cocoachina.com/gamedev/2013/0109/5504.html Cocos2D 如何使用Cocos2D制作一款简单的iphone游戏-1 如何使用C ...

  7. (译)在Objective-c里面使用property教程

    免责申明(必读!):本博客提供的所有教程的翻译原稿均来自于互联网,仅供学习交流之用,切勿进行商业传播.同时,转载时不要移除本申明.如产生任何纠纷,均与本博客所有人.发表该翻译稿之人无任何关系.谢谢合作 ...

  8. iOS-raywenderlich翻译-AFNetworking速成教程

    http://blog.csdn.net/beyondvincent/article/details/8691257 本文是由 iOS Tutorial 小组成员 Scott Sherwood撰写,他 ...

  9. ReactiveCocoa入门教程——第一部分

    本文翻译自RayWenderlich,原文:ReactiveCocoa Tutorial--The Definitive Introduction: Part 1/2 作为一个iOS开发者,你写的每一 ...

最新文章

  1. java中自造类是什么意思_Java建造者模式是什么?如何实现?(附代码)
  2. InnoDB purge原理--哪些undo log可purge
  3. Tableau系列之与R语言结合
  4. Kubernetes1.5新特性(一):Kubelet API增加认证和授权能力
  5. 记录 之 在华为NPU上变更镜像
  6. 【渝粤题库】陕西师范大学152102 管理学原理作业(高起专)
  7. kotlin和java语言_Kotlin VS Java – 2020年您应该学习哪种编程语言?
  8. Java 数组转化成集合
  9. Go实现Raft第一篇:介绍
  10. uban服务器系统,Web服务器-并发服务器-Epoll(3.4.5)
  11. 本表收录的字符的Unicode编码范围为19968至40869
  12. [20180626]函数与标量子查询14.txt
  13. Adobe Premiere 基本使用
  14. android 使用webview 加载网页
  15. 2022年考研数据结构_5 树
  16. JSP+MySQL基于SSM的高校毕业生就业管理系统
  17. Webstorm返回上一步操作快捷键 格式化代码快捷键
  18. 苹果雪豹操作系统正式版_苹果为旧机型发布iOS 12.4.2;macOS 10.14.6发布了,Catalina还远吗?...
  19. concurrent mode failure
  20. mysql 字段被截断_msyql存储数据时字段被截断

热门文章

  1. 详解道路标记数据集 CeyMo: See More on Roads -- A Novel Benchmark Dataset for Road Marking Detection
  2. 买iphone不买android,为何宁可用4年前的苹果6s,也不买两三千的安卓呢?理由很真实...
  3. 计算机考试前的心情作文,考试时的心情作文(七篇)
  4. java分布式锁工具类_java 通过redis实现分布式锁
  5. 复化科特斯公式matlab_matlab实现复化NewtonCotes公式求积分的程序应用和代码
  6. php config(),php config
  7. 命令测试post_【第2088期】前端中台化,把格局做大——NodeJS 和测试服务探索
  8. leetcode574. 当选者(SQL)
  9. linux-在cenos上安装大全(nginx/JRE/maven/Tomcat/MYSQL/redis/kafka/es...)
  10. Pytorch(1)-内置/自己设计的损失函数使用