AppIcon 的規格
規格這個由美術UI給出,具體的設計規格可以參考官方給出的規格要求
App Icons on iPhone, iPad and Apple Watch
AppIcon 的設定
設定資源放在專案的 Assets.xcassets 配置位置如下圖 (可以設定app圖示和啟動介面)

我們來看看新建一個專案中,Assets.xcassets

準備好我們的專案Icon(規格上圖可以看出是 20 29 40 60),拖入到這個資料夾中,並執行看效果


AppIcon 的設定完畢
App名字 的設定
我們先來看看 Info.plist檔案的元資訊,專案中的配置大多數都在這裡

這些屬性,我們只看和我們想要設定的App名字相關的 Bundle name
你還能看到"Bundle Name" and "Bundle display name"都設定為動態引數${PRODUCT_NAME}。 Bundle name - is folder name, where your app (including executable file and all resources) will be stored (Cool Program.app)。建議不要修改bundle name Bundle display name - is what will be shown on iPhone screen,即當你安裝該app到iPhone上顯示的name。 注意:Bundle Display name must correspond to Bundle name,即bundle display name和bundle name不能相差太遠。例如bundle name設定為 TheApplication, 而 bundle display name設定為“金瓶梅”,則apple會拒絕你的app。
但是上面我們新建一個專案的時候,我們並沒有看到有 Bundle Display name,這個key對應的是,我們app在手機上顯示的名稱,預設情況如果不設定,Bundle Display name的取值,是取Bundle name的值,從上面的圖片我們可以看到,App名字是我們專案的名稱:AppIcon
設定 Bundle Display name



如果我們去掉設定皮膚的 Display name ,Info.plist中的Bundle Display name也會消失掉。

我們在Info.plist新建一個Bundle Display name,也可以設定,一樣的效果。

App 啟動頁的設定
模擬器快捷鍵小技巧
command+shift+H 按一次 相當 HOME
command+shift+H 按兩次 可以關閉應用程式
首先我們來看下,啟動頁設定選項,有下面兩個

系統預設是載入一個 LaunchScreen.storyboard,下面是演示和驗證,我們在LaunchScreen.storyboard中新增一個按鈕來啟動app,可以看到啟動頁LaunchScreen.storyboard的變化

但是,通常情況下我會直接使用 Launch Images Source 方式展示啟動圖,省去了為啟動圖做適配的工作,只需要設計師提供不同尺寸的圖片資源就可以了。我們先刪除預設設定的LaunchScreen.storyboard,選擇 Launch Images Source,會在Assets.xcassets 生成一個LaunchImage的Assets,然後選中LaunchImage點選設定下面的內容,把我們準備好的圖片拖進去設定好就可以了。

我們來啟動看一下效果:

演示完畢..