File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -135,11 +135,11 @@ for beverage in Beverage.allCases {
135
135
136
136
例如,假设一个库存跟踪系统需要利用两种不同类型的条形码来跟踪商品。有些商品上标有使用 ` 0 ` 到 ` 9 ` 的数字的 UPC 格式的一维条形码。每一个条形码都有一个代表数字系统的数字,该数字后接五位代表厂商代码的数字,接下来是五位代表“产品代码”的数字。最后一个数字是检查位,用来验证代码是否被正确扫描:
137
137
138
- <img width =" 252 " height =" 120 " alt =" " src =" https://docs.swift.org/swift-book/_images/barcode_UPC_2x .png " >
138
+ <img width =" 252 " height =" 120 " alt =" " src =" https://docs.swift.org/swift-book/images/barcode_UPC@2x .png " >
139
139
140
140
其他商品上标有 QR 码格式的二维码,它可以使用任何 ISO 8859-1 字符,并且可以编码一个最多拥有 2,953 个字符的字符串:
141
141
142
- <img width =" 169 " height =" 169 " alt =" " src =" https://docs.swift.org/swift-book/_images/barcode_QR_2x .png " >
142
+ <img width =" 169 " height =" 169 " alt =" " src =" https://docs.swift.org/swift-book/images/barcode_QR@2x .png " >
143
143
144
144
这便于库存跟踪系统用包含四个整型值的元组存储 UPC 码,以及用任意长度的字符串储存 QR 码。
145
145
Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ print("hd is still \(hd.width) pixels wide")
166
166
167
167
将 ` hd ` 赋值给 ` cinema ` 时,` hd ` 中所存储的* 值* 会拷贝到新的 ` cinema ` 实例中。结果就是两个完全独立的实例包含了相同的数值。由于两者相互独立,因此将 ` cinema ` 的 ` width ` 修改为 ` 2048 ` 并不会影响 ` hd ` 中的 ` width ` 的值,如下图所示:
168
168
169
- ![ sharedStateStruct_2x] ( https://docs.swift.org/swift-book/_images/sharedStateStruct_2x .png )
169
+ ![ sharedStateStruct_2x] ( https://docs.swift.org/swift-book/images/sharedStateStruct@2x .png )
170
170
171
171
枚举也遵循相同的行为准则:
172
172
@@ -214,7 +214,7 @@ alsoTenEighty.frameRate = 30.0
214
214
215
215
因为类是引用类型,所以 ` tenEight ` 和 ` alsoTenEight ` 实际上引用的是同一个 ` VideoMode ` 实例。换句话说,它们是同一个实例的两种叫法,如下图所示:
216
216
217
- ![ sharedStateClass_2x] ( https://docs.swift.org/swift-book/_images/sharedStateClass_2x .png )
217
+ ![ sharedStateClass_2x] ( https://docs.swift.org/swift-book/images/sharedStateClass@2x .png )
218
218
219
219
通过查看 ` tenEighty ` 的 ` frameRate ` 属性,可以看到它正确地显示了底层的 ` VideoMode ` 实例的新帧率 ` 30.0 ` :
220
220
You can’t perform that action at this time.
0 commit comments