Gold Challenge - My Solution

I use these code

private static var realItems = [Item]()
var allItems: [Item] {
    get {
        return ItemStore.realItems
    }
    
    set(newAllItems) {
        ItemStore.realItems = newAllItems
    }
}

instead of static var allItems = [Item]()
No other associated code need to change.

1 Like