From 72cb5b0afef7fe861db5f8e30064478fa05f7025 Mon Sep 17 00:00:00 2001 From: Nicholas Tay Date: Sun, 20 Mar 2022 01:54:36 +1100 Subject: Split structs into other file, split networking out It isn't much so far, as it is just effectively the API retrieval function extracted from the TableViewController. But this should also allow other VCs to get from API too if required :^) --- foray/ForayItems.swift | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 foray/ForayItems.swift (limited to 'foray/ForayItems.swift') diff --git a/foray/ForayItems.swift b/foray/ForayItems.swift new file mode 100644 index 0000000..f1a1089 --- /dev/null +++ b/foray/ForayItems.swift @@ -0,0 +1,25 @@ +// +// ForayItems.swift +// foray +// +// Created by Nicholas Tay on 20/3/2022. +// + +import Foundation + +enum ItemType: String, Decodable { + case item + case quest +} + +struct YearSection { + var year: Date + var items: [PenguinItem] +} + +struct PenguinItem: Decodable { + var type: ItemType + var releaseDate: Date + var id: String + var name: String +} -- cgit