xcode11 新功能_Xcode 11功能

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。

Xcode 11功能 (Xcode 11 Features)

Some of the XCode 11 features are:

XCode 11的一些功能包括:

  • SwiftUI

    SwiftUI
  • Minimap

    小地图
  • Rich Documentation

    丰富的文档
  • Swift Package Manager

    迅捷软件包管理器
  • Inline Diff

    内联差异
  • Transform iPad Apps to Mac

    将iPad应用程序转换为Mac
  • Debugging and Simulators

    调试和模拟器

Let’s look into each of these one by one.

让我们逐一研究一下。

1. SwiftUI (1. SwiftUI)

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代码的声明式语法。 添加动画和内容非常容易。

Xcode 11 Swiftui

Xcode 11 Swiftui

Xcode 11 Swiftui

This is a major shift from the Storyboards and drag and drop setup. The only issue:

这是从情节提要和拖放设置的重大转变。 唯一的问题:


Hence use it only if your app supports iOS 13 and above.
因此,仅当您的应用支持iOS 13及更高版本时才使用它。

To use SwiftUI, select the toolbox from the project setup window as shown below:

要使用SwiftUI,请从项目设置窗口中选择工具箱,如下所示:

Xcode Swiftui 2

Xcode Swiftui Setup

Xcode Swiftui安装程序

2.小​​地图 (2. Minimap)

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中非常需要此功能,并且期待已久。

Xcode 11 Minimap

Xcode 11 Minimap

Xcode 11小地图

3.丰富的文档 (3. Rich Documentation)

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:

这是一个简单的窥探:

Xcode11 Rich Documentation

Xcode11 Rich Documentation

Xcode11丰富的文档

4. Swift软件包管理器 (4. Swift Package Manager)

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存储库列表中搜索该软件包来添加依赖项。

Xcode11 Swift Package Manager

Xcode11 Swift Package Manager

Xcode11 Swift软件包管理器

Once you’ve added the dependency it will be shown at the bottom of your project in the left sidebar.

添加依赖项后,它将显示在项目底部的左侧边栏中。

5.内联差异 (5. Inline Diff)

Xcode 11 provides an improved UI to show changes in each line of code based on version control as shown below:

Xcode 11提供了一个改进的UI,以基于版本控制显示每行代码中的更改,如下所示:

Xcode11 Inline Diff

Xcode11 Inline Diff

Xcode11内联差异

Clicking the blue bar at the left shows us options to discard changes or view the diff. Certainly, the diff feature is handy.

单击左侧的蓝色条会向我们显示放弃更改或查看差异的选项。 当然,差异功能很方便。

6.将iPad Apps转换为Mac (6. Transform iPad Apps to Mac)

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应用程序。 您可以通过执行“项目导航器”并选择相关复选框,如下所示:

Xcode11 Ipadtomac

Xcode11 Ipadtomac

Xcode11的Ipadtomac

7.调试和模拟器 (7. Debugging and Simulators)

  • iOS Simulator speed has vastly improved in Xcode 11. They are now much faster thus removing the over-reliance of external devices for testing most of the stuff.

    iOS模拟器的速度在Xcode 11中得到了极大的提高,现在它们的速度要快得多,从而消除了对测试大多数内容的外部设备的依赖。
  • Starting XCode 11, you won’t have a simulator for every possible device but only for the commonly used devices. This saves a lot of disk space.

    从XCode 11开始,您将不会为所有可能的设备都配备模拟器,而只会为常用的设备配备模拟器。 这样可以节省大量磁盘空间。
  • Metal framework code can now be run and tested on iOS 13 and tvOS 13 simulators. They’ll use the Mac’s GPU.

    金属框架代码现在可以在iOS 13和tvOS 13模拟器上运行和测试。 他们将使用Mac的GPU。
  • You can now debug your application under simulated environments like low battery, thermal warnings, slow network.

    现在,您可以在电池电量不足,过热警告,网络速度缓慢等模拟环境下调试应用程序。
  • iOS 13 dark theme is a game changer. During debugging on iOS 13, we can switch between light and dark modes easily from our Xcode debugger.

    iOS 13黑暗主题将改变游戏规则。 在iOS 13上进行调试的过程中,我们可以通过Xcode调试器轻松在亮模式和暗模式之间切换。

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 新功能

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值