iT邦幫忙

2025 iThome 鐵人賽

DAY 12
0
Mobile Development

我將點燃Swiftの大海系列 第 12

Day12. Xcodeの基礎設定

  • 分享至 

  • xImage
  •  

我們寫程式碼時會需要用到開發環境,今天跟大家介紹我在編寫app時會用的開發軟體!

Xcode 下載篇

我們今天要介紹的是xcode的開發環境,我相信要寫ios App的你一定會有mac吧!
直接去App Store下載xcode就能用了喔!
https://ithelp.ithome.com.tw/upload/images/20250926/20178747d6lcFToxxv.png

Xcode 建制專案篇

下載好後我們打開 Xcode 就會跳出這個畫面來

step1.

點選 Create New Project
https://ithelp.ithome.com.tw/upload/images/20250926/201787479xEsmcE54c.png

step2.

點選專案為 App
按下Next 前往下一步
https://ithelp.ithome.com.tw/upload/images/20250926/20178747kGZ7hpSyTn.png

step3.

接著輸入 專案名稱 以及將 interface 改為 Storyboard
按下 Next 前往下一步
https://ithelp.ithome.com.tw/upload/images/20250926/20178747fTbPEVw3wY.png

Xcode 初始化設定篇

step1.

在我們建置好專案後預設會給我們這些檔案
在紅色框框內的檔案是我們不要的所以直接刪掉!
https://ithelp.ithome.com.tw/upload/images/20250926/20178747WOaQEYEEyK.png

step2.

接著點選最上層的專案檔,我們開始對這個專案做初始化的設定
點選上面的 info
下方有一個 Application Scene Manifest
我們直接將它展開到最底下後會看到一個 Valuemain 的檔案並將它刪掉!
https://ithelp.ithome.com.tw/upload/images/20250926/20178747fbCjgOEMqo.png
完成後來到 info 旁邊的 Build Setting
在搜尋欄搜索 main 後將顯示出來的檔案刪掉!https://ithelp.ithome.com.tw/upload/images/20250926/20178747om09q807Gc.png

step3.

接下來我們要來建置我們自己的 MainViewController
在專案擋下方的資料夾上按右鍵選擇 New File from Template
https://ithelp.ithome.com.tw/upload/images/20250926/20178747afq3JziHpP.png
它會跳出一個的視窗選擇 Cocoa Touch Classhttps://ithelp.ithome.com.tw/upload/images/20250926/20178747EgtUhdjBhB.png
接下來按照需求選擇 UIViewController 並將名字設為 MainViewController
勾選 Also Create XIB filehttps://ithelp.ithome.com.tw/upload/images/20250926/20178747xYLDTGq5bp.png
最後設定好 MainViewController 的Mark方便閱讀
https://ithelp.ithome.com.tw/upload/images/20250926/20178747R6SouF4GCa.png
以及設定好 SceneDelegate 的設定連接到我們的 MainViewController
就大功告成可以開始寫我們的程式啦!

https://ithelp.ithome.com.tw/upload/images/20250926/20178747XOk0zjqTzV.png


上一篇
Day11. Swift 一定要會の基礎語法
下一篇
Day13. 做專案一定要會のGit版本控制
系列文
我將點燃Swiftの大海16
圖片
  熱門推薦
圖片
{{ item.channelVendor }} | {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言