From feb249782e8e9867e9c13062a41f0784bd129691 Mon Sep 17 00:00:00 2001 From: Majid Jabrayilov Date: Tue, 20 Feb 2024 23:53:37 +0400 Subject: [PATCH] code examples in swift collection posts fixed --- _posts/2024-02-19-discovering-swift-collections-package.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_posts/2024-02-19-discovering-swift-collections-package.md b/_posts/2024-02-19-discovering-swift-collections-package.md index 75833360..0fc10fd5 100644 --- a/_posts/2024-02-19-discovering-swift-collections-package.md +++ b/_posts/2024-02-19-discovering-swift-collections-package.md @@ -63,7 +63,7 @@ struct Event: Identifiable, Comparable { @Observable final class EventStore { typealias Fetch = () async -> [Event] - private(set) var events: Heap + private(set) var events: Heap = [] private let fetch: Fetch init(fetch: @escaping Fetch) { @@ -83,7 +83,7 @@ As you can see in the example above, we fetch the calendar events and populate t ```swift @Observable final class EventStore { - private(set) var events: Heap + private(set) var events: Heap = [] func printEvents() { for event in events.unordered {