Xcode

Xcode is Apple’s integrated development environment (IDE). You use Xcode to build apps for Apple products, including iPad, iPhone, Apple Watch, Apple TV, and Mac. Xcode provides tools to manage your entire development workflow—from creating your app to testing, optimizing, and submitting it to the App Store.

A project keeps the necessary files and resources for developing your app organized. To create a project, start with one of the templates, then modify it however you like. Templates are available for each platform (iOS, watchOS, tvOS, and macOS) and for common types of apps, frameworks, and libraries. Each template comes preconfigured with default settings and is ready to build and run. To see an interactive preview while laying out the interface and editing code, choose Swift as the programming language, and SwiftUI as the user interface.

image

After you create a project, the main window appears. This window is your primary interface for viewing, editing, and managing all the parts of your project. It's flexible and configurable, adapting to the needs of the task at hand and allowing you to configure it to fit your work style.

image

Use the navigator area (

image

) for quick access to different parts of your project. Click a button in the navigator bar to show the corresponding parts in the content area below the navigator bar.

image

For example, select a file that uses SwiftUI in the Project navigator (

image

) to open it in the source editor in the editor area, then click the Resume button on the right to start the preview. Xcode keeps the code on the left in sync with the interactive preview on the right. Use the controls in the canvas to run the app on a simulated device (with or without a debug session) or run the app on a connected device. A debug session opens in the debug area (

image

) below the editor area.

image

To use ready-made resources, click the Library button (+) in the toolbar, then select the type of resource to add. For example, select the Views library to access standard user interface elements. Drag the element you want from the library to the canvas or the source editor. Regardless of where you make the changes, Xcode keeps the preview and source code in sync.

image

Use the inspector area (

image

) to view and edit information for an object that you've selected in the navigator or editor area. To show an inspector, click the corresponding button in the inspector bar. For example, select a user interface element in the source editor or preview, then choose View > Inspectors > Show Attributes Inspector. Change the values in the inspector and Xcode updates the source code and the preview. You can also Command-click an element in the source code or preview to edit the attributes in a popover.

image

To see descriptions of the symbols, interface objects, and build settings you select in the editor area, click the Quick Help inspector (

image

) in the inspector bar, or choose View > Inspectors > Show Quick Help Inspector. To view the full documentation for a symbol, click the Open in Developer Documentation link at the bottom of the Quick Help inspector.

image

Alternatively, Option-click a symbol in the source editor (or Command-click the symbol, then choose Show Quick Help) to see a brief description of the symbol in a popover. To dismiss the popover, press Escape or click anywhere in the file.

image

Use the toolbar to build and run your app, view the progress of running tasks, and configure your work environment. You’ll choose a run destination—for example, a simulator or device—from the scheme menu. Use the segmented control located on the right of the toolbar to show and hide the navigator, debug, and inspector areas of the main window.

image

Select the project (the root file in the Project navigator) to open the project editor. Use this editor to view and edit your project and other settings. Use the tabs to switch between the different types of settings. For example, click Signing & Capabilities to provide information for code signing, needed to run on a device, and enable services provided by Apple.

image
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末星虹,一起剝皮案震驚了整個濱河市,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌,老刑警劉巖,帶你破解...
    沈念sama閱讀 218,682評論 6 507
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件舰涌,死亡現(xiàn)場離奇詭異,居然都是意外死亡,警方通過查閱死者的電腦和手機趣些,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,277評論 3 395
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來螺垢,“玉大人喧务,你說我怎么就攤上這事⊥髌裕” “怎么了功茴?”我有些...
    開封第一講書人閱讀 165,083評論 0 355
  • 文/不壞的土叔 我叫張陵,是天一觀的道長孽亲。 經(jīng)常有香客問我坎穿,道長,這世上最難降的妖魔是什么返劲? 我笑而不...
    開封第一講書人閱讀 58,763評論 1 295
  • 正文 為了忘掉前任玲昧,我火速辦了婚禮,結(jié)果婚禮上篮绿,老公的妹妹穿的比我還像新娘孵延。我一直安慰自己,他們只是感情好亲配,可當(dāng)我...
    茶點故事閱讀 67,785評論 6 392
  • 文/花漫 我一把揭開白布尘应。 她就那樣靜靜地躺著,像睡著了一般吼虎。 火紅的嫁衣襯著肌膚如雪犬钢。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 51,624評論 1 305
  • 那天思灰,我揣著相機與錄音玷犹,去河邊找鬼。 笑死洒疚,一個胖子當(dāng)著我的面吹牛歹颓,可吹牛的內(nèi)容都是我干的坯屿。 我是一名探鬼主播,決...
    沈念sama閱讀 40,358評論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼晴股,長吁一口氣:“原來是場噩夢啊……” “哼愿伴!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起电湘,我...
    開封第一講書人閱讀 39,261評論 0 276
  • 序言:老撾萬榮一對情侶失蹤隔节,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后寂呛,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體怎诫,經(jīng)...
    沈念sama閱讀 45,722評論 1 315
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點故事閱讀 37,900評論 3 336
  • 正文 我和宋清朗相戀三年贷痪,在試婚紗的時候發(fā)現(xiàn)自己被綠了幻妓。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 40,030評論 1 350
  • 序言:一個原本活蹦亂跳的男人離奇死亡劫拢,死狀恐怖肉津,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情舱沧,我是刑警寧澤妹沙,帶...
    沈念sama閱讀 35,737評論 5 346
  • 正文 年R本政府宣布,位于F島的核電站熟吏,受9級特大地震影響距糖,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜牵寺,卻給世界環(huán)境...
    茶點故事閱讀 41,360評論 3 330
  • 文/蒙蒙 一悍引、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧帽氓,春花似錦趣斤、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,941評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至奋渔,卻和暖如春镊逝,著一層夾襖步出監(jiān)牢的瞬間壮啊,已是汗流浹背嫉鲸。 一陣腳步聲響...
    開封第一講書人閱讀 33,057評論 1 270
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留歹啼,地道東北人玄渗。 一個月前我還...
    沈念sama閱讀 48,237評論 3 371
  • 正文 我出身青樓座菠,卻偏偏與公主長得像,于是被迫代替她去往敵國和親藤树。 傳聞我的和親對象是個殘疾皇子浴滴,可洞房花燭夜當(dāng)晚...
    茶點故事閱讀 44,976評論 2 355

推薦閱讀更多精彩內(nèi)容