日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

[raywenderlich教程]

發布時間:2023/12/18 编程问答 50 豆豆
生活随笔 收集整理的這篇文章主要介紹了 [raywenderlich教程] 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

非常詳細的圖文入門教程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教程]的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。