xcode11 新功能
WWDC 2019 is over and we can’t wait to discuss what’s in store for the developers. Today, we’ll be discussing the new features available in Xcode 11.
WWDC 2019已经结束,我们迫不及待地想要为开发人员讨论即将发布的产品。 今天,我们将讨论Xcode 11中可用的新功能。
Xcode 11 includes the support for Swift 5.1. Also, it includes SDKs for iOS 13, tvOS 13, watchOS 6, and macOS Catalina 10.15.
Xcode 11包括对Swift 5.1的支持。 此外,它还包括适用于iOS 13,tvOS 13,watchOS 6和macOS Catalina 10.15的SDK。
Some of the XCode 11 features are:
XCode 11的一些功能包括:
Let’s look into each of these one by one.
让我们逐一研究一下。
SwiftUI is the big announcement this year. It’s a new framework introduced for easily creating layouts using swift code. Moreover, Xcode shows us a real app like interface viewer side by side while you edit the Swift file.
It requires a Declarative syntax which is easy to use Swift code. Adding animations and stuff is all very easy.
SwiftUI是今年的重要公告。 这是一个新框架,旨在使用快速代码轻松创建布局。 此外,当您编辑Swift文件时,Xcode并排显示了一个真正的应用程序,例如界面查看器。
它需要一种易于使用的Swift代码的声明式语法。 添加动画和内容非常容易。
This is a major shift from the Storyboards and drag and drop setup. The only issue:
这是从情节提要和拖放设置的重大转变。 唯一的问题:
To use SwiftUI, select the toolbox from the project setup window as shown below:
要使用SwiftUI,请从项目设置窗口中选择工具箱,如下所示:
Xcode has an awesome looking minimap of your code at the left. You can quickly go to a specific part of your code through it.
Xcode在左侧有一个很棒的代码迷你图。 您可以通过它快速进入代码的特定部分。
This feature was much needed and long awaited in Xcode since it was already available in many other editors like Atom etc.
由于Xcode已在许多其他编辑器(例如Atom等)中提供,因此在Xcode中非常需要此功能,并且期待已久。
The documentation looks better in Xcode 11. The MARK
keyword followed by a hyphen has a much bolder text which is clearly visible in the minimap as well.
该文档在Xcode 11中看起来更好MARK
关键字后跟一个连字符,它的文本大胆得多,在小地图中也清晰可见。
Here’s a sneak peek into it:
这是一个简单的窥探:
Up until now, to add third-party libraries or dependencies, we had to use Cocoapods or Carthage.
到目前为止,要添加第三方库或依赖项,我们必须使用Cocoapods或Carthage。
Xcode 11 introduces its own built-in package manager. Just go to files – Swift Packages and add a dependency by searching the package through the list of GitHub repositories.
Xcode 11引入了自己的内置包管理器。 只需转至文件– Swift Packages并通过在GitHub存储库列表中搜索该软件包来添加依赖项。
Once you’ve added the dependency it will be shown at the bottom of your project in the left sidebar.
添加依赖项后,它将显示在项目底部的左侧边栏中。
Xcode 11 provides an improved UI to show changes in each line of code based on version control as shown below:
Xcode 11提供了一个改进的UI,以基于版本控制显示每行代码中的更改,如下所示:
Clicking the blue bar at the left shows us options to discard changes or view the diff. Certainly, the diff feature is handy.
单击左侧的蓝色条会向我们显示放弃更改或查看差异的选项。 当然,差异功能很方便。
With Xcode 11, it’s easy to port and run ipad apps on mac natively. You can do so by doing to the Project Navigator and selecting the relevant checkbox as shown below:
使用Xcode 11,很容易在Mac上本地移植和运行ipad应用程序。 您可以通过执行“项目导航器”并选择相关复选框,如下所示:
That brings an end to this article on Xcode 11 features. If I have missed an important feature, please let me know through comments.
这结束了有关Xcode 11功能的本文。 如果我错过了重要功能,请通过评论告知我。
翻译自: https://www.journaldev.com/30976/xcode-11-features
xcode11 新功能