Cowboy Tech

WWDC2016学习笔记-Introduction_to_Xcode

Four scheme actions

1

  • Run will run my app in the debugger.
  • Test will run my tests.
  • Profile will run my app in instruments so I can measure its performance.
  • Analyze will run Xcode’s static analyzer and help catch problems I might otherwise have missed
  • Archive action will build my app for release.This command will become enabled in this menu once I select a device as my run destination.

查看不同设备屏幕的Storyboard scene

3

Method classify

使用TODO or MARK 使方法归类。直接输入可自动弹出搜索框

4

7

import Foundation

// TODO: Call Hero

let myHero = "Mother"

func callHero(){

    print (myHero)

}


// MARK: Call Father

func callMather(){

    print (myHero)

}

PO Command in console

5

Search shortcut key

shift + command + O

2

6

Option or Command + click

查看某方法或对象的详情

8

Project & Target

9

Project

A project is a document that you use to organize your code an resources in Xcode.

project settings

deployment target is the minimum OS version that your app can run on and support.

10

Target

targets which actually build those files into products like your app

A target contains the instructions to build one thing like an app or a framework.

11

Build phases

The thing that your target produces is called its product. The set of steps that your target takes to build its product are called build phases.

12

Build Setting for project & target

Build settings which configure how your targets build their products, schemes which configure how you perform actions, such as Run, with your targets.

Both projects and targets have Build settings, and targets inherit the value set at the project level but can override them with a target-specific value.

13

A Build setting contains a name and a value of some aspect that controls some aspect of the build process.

For example, there are Build settings for specifying which architectures you want to build, whether your code is optimized, what your product is named, and even how you deal with warnings.

16

Now, Build settings can also vary by what’s called a build configuration, and by default, a project has a debug and a release configuration. For example, when you’re building for debug, you probably don’t want your code to be optimized, but when you’re building for release, you do want your code to be optimized.

17

Target’s build phases

A target’s build phases do things like cause dependencies to build first, compile the source files in that target, and link the target against libraries and frameworks.

You can also add what’s called a run script build phase to configure other aspects of the build that you’d like.

14

Capabilities

Capabilities, which allows you to easily turn on specific features.

For example, for iOS, there are capabilities for enabling in-app purchases and Apple Maps integration

18

Workspaces

Two projects that share the same framework and you like to work on them together.

In this situation, you can create an Xcode workspace that references your projects. So when you open your workspace in Xcode,

it’ll contain all of the contents of the projects that you’ve referenced, which makes it easy to edit and navigate across them

as related code.

19

有待进一步学习的地方

Review & Commit

Edit Scheme

Test

Debug