关于Xcode

(还未搞懂怎么用CSDN博客的markdown编辑器,段前空格怎么加?)
英文原文来自苹果官方文档:Xcode Overview

一、XCODE 概述

Whether you are using Swift, Objective-C, C, C++, or a mix, Xcode
checks your source code as you type it. When Xcode notices a mistake,
the source code editor highlights the error and when possible, offers
to fix it. Xcode speeds up your typing with intelligent code
completion. Reduce your typing further with ready-to-use code snippets
and source file templates, either the ones provided or ones you add.
With Swift, playgrounds let you experiment with code without building
and running your app.

不论是使用Swift,OC,C,C++还是混合语言编程,Xcode都可以在你编辑代码的同时对代码进行检查。当发现错误时,Xcode会高亮代码进行提示(若可能,还会给出修改建议)。Xcode自带代码自动补全功能,并且在未来会自带Ready to use的代码片段,以及源代码模板(自带或用户添加),以减少代码手动输入量。对于Swift,Playgrounds可以让用户实时查看代码效果,而不必每次都构建和运行程序。
这里写图片描述


2、 You can easily configure the source editor to display multiple
views of the same file or to view multiple related files at once.
Search-and-replace and refactoring operations help you make extensive
changes to your code quickly and safely.

用户可以轻松配置源代码编辑器,使用不同的视图来查看同一段代码,或者同时查看多个相关文件。
查找替换功能以及Refactor可以快速安全地帮助用户扩展代码。

这里写图片描述


(上面开始几段由于博客编辑器操作乱了,不知道怎么改好,和原文顺序不一致)


Graphical UI Design 用户界面设计

Interface Builder is a visual design editor that’s integrated into
Xcode. Use Interface Builder to create the user interfaces of your
iOS, watchOS, or OS X apps by assembling windows, views, controls,
menus, and other elements from a library of configurable objects, or
from ones you create. Use storyboards to specify the flow of your app
and the transitions between scenes. Then graphically connect the
objects and transitions to your implementation code.

Interface Builder(IB)是一个可视化设计编辑器,已集成在Xcode内。IB配合组件库中的各种控件(窗体、视图、控制、菜单、以及自定义控件)可以创建IOS,watchOS,以及OSX应用程序的界面。还可以使用StoryBoards来定义用户程序的界面跳转和场景切换。另外还可以可视化地将对象和Transitions同实现代码进行连接。这里写图片描述

With the Auto Layout feature, define constraints for your objects so
that they automatically adjust to screen size, window size, and
localization. With size classes, tune your mobile UI for any
combination of screen size and orientation: customizing Auto Layout
constraints, adding or removing views, and even changing the font.

使用自动框架功能定义框架以约束对象,这样就能让若干框架内的对象可以自动地适应屏幕尺寸,窗体尺寸以及实现本地化。还可利用SIZE类,协调用户的移动应用界面以适应任意的屏幕尺寸和旋转组合:该类可以自动地定义约束框架,添加或移除视图,甚至是自动改变字体。这里写图片描述

The asset catalog in Xcode helps you manage graphics and data files
for your app. Graphics include the many images you’ll use for your
app’s user interface—items such as icons, custom artwork, sprites, and
launch images for iOS devices.

Xcode内的资源目录(asset catalog)帮助管理用户创建的应用程序内的图形(Graphics)和数据(Data)文件。Graphics包括应用于UI的图像:包括图标,自定义的图形,子图形(sprites),以及IOS设备的登录图像。这里写图片描述

With the particle emitter editor in Xcode, you can enhance your iOS or
Mac game by adding animation effects that involve moving particles
such as snow, sparks, and smoke. The SceneKit editor helps you work
with scenes created in 3D authoring tools and exported as digital
asset exchange (DAE) files.

使用粒子特效库编辑器(Particle emitter editor暂译),用户能够加入如雪花、火焰、烟雾等动态粒子特效,以此提升IOS和MAC平台的游戏效果。SceneKit 编辑器可以编辑其它三维创作工具制作的三维场景,并且可以DAE(digital asset exchange)格式导出3D文件。这里写图片描述
相关阅读:
Using Interface Builder and Adding Assets.


Integrated Debugging

集成调试环境

When Xcode launches your app in debug mode, it immediately starts a
debugging session. If you are running an iOS or watchOS app, Xcode
launches it either in Simulator or on a device connected to your Mac.
If you are running an OS X app, Xcode launches it directly on your
Mac.

Xcode直接开启一个调试会话来加载用户APP到调试模式。若调试一个IOS或watchOS应用,用户可以选择将它加载到Xcode的设备模拟器环境中或者是进行真机调试。若调试一个OSX应用,则Xcode直接将其加载到Mac上。这里写图片描述

You can debug your app directly within the source editor. View the
contents of an object by moving your pointer over a variable name, and
then use Quick Look to inspect a particular value. The debug area and
the debug navigator let you carefully control the execution of your
app while you examine the code. For finer control, the console gives
command line access to the debugger.

用户能在编辑器中直接调试代码,当移动鼠标指针到一个变量上时,会显示该变量对象的内容,并且可以利用快速查看功能浏览对象内的特定值。调试区和调试向导能让用户对程序的调试过程进行地精确控制。为了更加良好地控制这个过程,Xcode还在控制台添加了调试器控制命令。这里写图片描述

Debug gauges display your app’s resource consumption to help you
identify problems before your users do.

调试器可以显示程序的资源消耗状况,在发布程序之前帮助定位问题所在。这里写图片描述
相关阅读:
Building Your App and Using the Debugger.


Testing and Continuous Integrations

To help you build a better app, Xcode includes a testing framework for
functional, performance, and user interface testing. You write the
tests and use the test navigator to run those tests and see the
results. Test code functionality with unit tests and see your current
code coverage. Performance tests make sure important parts of your app
don’t leave the user waiting. Automate testing of your user experience
to make sure changes in one place don’t break things in another. Set
triggers for running tests on a regular basis so you catch regression
bugs in code and in performance.

为帮助用户更好地构建程序,Xcode包含了一个测试框架,用于程序的功能、运行性能以及UI可用性测试。用户可以写测试代码,并使用测试面板来执行测试并获得测试结果。单元测试(Unit tests)用于测试源代码功能特性,并且可以知道当前测试覆盖范围。对构建的程序运行性能测试(Performance tests)可以保证程序的实际执行性能。Xcode可以自动评价应用的用户体验,保证程序的一部分修改不会影响到程序的其它部分。在常规使用条件下,为你的应用设置运行测试(Running tests),检查代码或运行性能上的回归缺陷。
(Regression bug,regression test是回归测试,一般是在一轮测试结束以后,在大部分bug已修改完成的版本上,测试人员重新按照前一轮的测试用例再测试一遍。或者,测试已经close的bug)。

Run your tests in the test navigator, look at the results, and make
any changes needed to pass the tests. You can use the Xcode service,
available in OS X Server, to automate the execution of tests. From
Xcode on your development Mac, you create bots that run on a separate
server to execute your unit tests either periodically or on every
source code commit.

为了保证程序最后的执行效果,应在测试面板中运行测试,并根据结果修改程序,知道通过所有测试。你能够使用Xcode在OSX Server中提供的服务进行自动化测试。可以从你运行Xcode的Mac上创建Bots(bots是一种能够在本地自动执行外部命令的程序,执行重复功能程序),并运行在测试服务器上,这样就可以定期或者是每次代码提交时都可以执行单元测试。这里写图片描述

In addition to running unit tests, bots automatically perform static
analysis on your code, build your app, and archive it for distribution
to testers or the App Store. While performing these continuous
integrations of your app, bots report build errors and warnings,
static analyzer problems, and unit test failures.

另外,bots还能自动地对代码进行静态分析、构建程序,并将程序归档(用于分发给程序测试者或用于直接提交给App Store)。当进行这些持续集成(Continuous Integrations, 现代敏捷软件开发提出了持续集成。)工作时,bots能够报告:1.构建时的警告和错误2.静态分析器发现的问题3.单元测试时的错误。
(译注:大师Martin Fowler对持续集成是这样定义的:持续集成是一种软件开发实践,即团队开发成员经常集成他们的工作,通常每个成员每天至少集成一次,也就意味着每天可能会发生多次集成。每次集成都通过自动化的构建(包括编译,发布,自动化测试)来验证,从而尽快地发现集成错误。许多团队发现这个过程可以大大减少集成的问题,让团队能够更快的开发内聚的软件。)

相关阅读:
Testing.


Automatic Saves and Source Control Management

自动保存和源代码管理

While you work, Xcode automatically saves changes to source and
project files. This feature requires no configuration, because Xcode
continuously tracks your changes and saves them. You can revert a file
to a previous state with the Undo and Revert Document commands.

当你工作时,Xcode 可以自动保存工程中的各种修改(这个功能是自动的,无需额外设置,因为Xcode在自动地持续追踪你的修改并对修改进行保存)。你也可以使用Undo功能或Revert Document命令,直接恢复一个文件到之前的状态。

To keep track of changes at a fine-grained level, use the Xcode source
control management features. Xcode supports two popular source control
systems: Git and Subversion. You can access remote Git and Subversion
source code repositories, and you can create local Git repositories.
Using the Xcode service, available with OS X Server, you can host Git
repositories on your own server.

为更加精细地追踪代码,可以使用Xcode提供的源代码管理控制(Source control management)功能。Xcode支持两种流行的源代码管理工具:Git和Subversion。在Xcode内,你可以访问Git或Subversion的远程代码仓库,也可以创建本地的Git代码仓库。使用Xcode服务,在OSX服务器内,你可以自己建立Git服务器。这里写图片描述

相关阅读:
Managing Changes.


Integrated Documentation

集成文档:

While you’re coding, Xcode makes detailed technical information
available at your fingertips. When you want it, Quick Help keeps
concise API information always in view, and Xcode application help is
always close at hand with step-by-step instructions for performing
common Xcode tasks. Xcode includes extensive documentation for using
Xcode, and it provides comprehensive SDK documentation, including
programming guides, tutorials, sample code, detailed framework API
references, and video presentations by Apple engineers. All of these
resources are viewable from the Xcode documentation viewer. As updated
documentation becomes available, it downloads automatically in the
background.
这里写图片描述

相关阅读:
Learning More.


App Distribution to Testers and the App Store

向测试人员和应用商店发布程序:

Most of your development time is spent on coding tasks, but to develop
for the App Store, you need to perform a number of administrative
tasks throughout the lifetime of your app. In addition to Xcode,
you’ll use the Member Center web tool to manage developer program
accounts and entitlements, and you’ll use the iTunes Connect web tool
to check the status of your contracts, set up tax and banking
information, obtain sales and finance reports, and manage metadata
about the app.

程序的创建时间大部分是花在编码工作当中,但是若想发布程序到应用商店,你还需要在应用的生命期内进行一系列的管理工作。就Xcode而言,你需要使用它里面的开发者网络工具(Member Center web tool)来管理你的开发者账号及权限。另外你也能利用iTunes Connect web tool来检查你的合同(contracts)状态,并保存你的税收和银行信息,接收销售和资产报告,以及管理你应用的元数据(metadata)。

Xcode project configurations help prepare your app for TestFlight or
for manual distribution to beta testers, and for submission to the App
Store. Submitting your app is a multistep process that begins when you
sign into iTunes Connect and supply necessary product information. In
Xcode, you create an archive of your project and submit it to the
store. When your app is approved, you use iTunes Connect to release it
by setting the date. (If you are distributing your OS X app outside
the store, you follow a slightly different process.)

Xcode的project configurations可以帮助你准备你的应用进行试运行,或者你也可以手动发布给测试用户,或者是直接提交给苹果应用商店。提交你的应用涉及到多个步骤,开始是注册并登陆到iTunes,提交必要的产品信息,之后再在Xcode内建立一个应用程序并归档,然后将它提交给应用商店。当你的应用认证通过(approved)后,你就可以在iTunes内添加日期并进行发布了。
(若是在应用商店以外发布OSX平台上面的程序,则步骤有所不同。)
相关阅读:
App Distribution Guide.

1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看REaDME.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。 1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md或论文文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。 5、资源来自互联网采集,如有侵权,私聊博主删除。 6、可私信博主看论文后选择购买源代码。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值