File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
swift-6-beta.docc/LanguageGuide Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change 2
2
3
3
处理常见数据类型并编写基本语法。
4
4
5
- Swift 提供了许多基本数据类型,包括表示整数的 ` Int ` 、表示浮点数的 ` Double ` 、表示布尔值的 ` Bool ` 和表示文本的 ` String ` 。Swift 还提供了三种主要集合类型(` Array ` (数组),` Set ` (集合),和 ` Dictionary ` (字典))的强大版本,详见< doc:CollectionTypes > 。
5
+ Swift 提供了许多基本数据类型,包括表示整数的 ` Int ` 、表示浮点数的 ` Double ` 、表示布尔值的 ` Bool ` 和表示文本的 ` String ` 。Swift 还提供了三种主要集合类型(` Array ` (数组),` Set ` (集合),和 ` Dictionary ` (字典))的强大版本,详见 < doc:CollectionTypes > 。
6
6
7
7
Swift 使用变量来存储值,并通过标识名称来引用值。Swift 还广泛使用不可更改其值的变量。这些变量被称为常量,在整个 Swift 中都有使用,以便在处理无需更改的值时使代码更安全、更清晰。
8
8
@@ -1523,8 +1523,7 @@ assert(age >= 0)
1523
1523
```
1524
1524
-->
1525
1525
1526
- 如果代码已经检查了条件,则使用 [ ` assertionFailure(_:file:line:) ` ] ( https://developer.apple.com/documentation/swift/1539616-assertionfailure ) 函数来表示断言失败。
1527
- 例如:
1526
+ 如果代码已经检查了条件,则使用 [ ` assertionFailure(_:file:line:) ` ] ( https://developer.apple.com/documentation/swift/1539616-assertionfailure ) 函数来表示断言失败。例如:
1528
1527
1529
1528
``` swift
1530
1529
if age > 10 {
You can’t perform that action at this time.
0 commit comments