From 8d0a87909eb9204c33a4c860d3728be5debf87d1 Mon Sep 17 00:00:00 2001 From: Phenmod Date: Wed, 30 Oct 2019 17:17:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=91=E4=B8=80=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/01_welcome_to_swift/03_a_swift_tour.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/01_welcome_to_swift/03_a_swift_tour.md b/source/01_welcome_to_swift/03_a_swift_tour.md index 8240ffc4..917ad358 100755 --- a/source/01_welcome_to_swift/03_a_swift_tour.md +++ b/source/01_welcome_to_swift/03_a_swift_tour.md @@ -87,6 +87,13 @@ var occupations = [ occupations["Jayne"] = "Public Relations" ``` +数组在添加元素时会自动变大。 + +```swift +shoppingList.append("blue paint") +print(shoppingList) +``` + 使用初始化语法来创建一个空数组或者空字典。 ```swift