Hello!
This is actually my first stab at an app challenge and journal like this, so we’ll see how it goes.
Right now I’m focusing on the basic requirements, with the others attempted at once the basic ones are done.
Day 1 and 2
My first two days were spent reading API documentation, creating models, and creating the view model.
I’m pulling data mainly from the Teams (All) and Games by Date APIs. I will also be pulling from the Current Season and Are Any Games In Progress APIs as well for additional information.
I created models for a Team, a Game, and a Season.
I created a Constants file for the api urls and key.
For some of the data sent back, the documentation says it’s of type Date or DateTime. Turns out you can just using strings for these.
I also got to play around with Date, Calendar, and DateFormatter objects to get dates and adjust the data forward or back. These also came in use since I have to pass in a date with the format of 2021-JUL-04. I had a helper function handle the month and the main function handle everything else related to fetching data from the Games by Date API.
Each API had it’s own function to call the data from since the return types differed. I have three game-storing array properties for each day and one for the team.
I also did some setup in my view model since it’s possible there aren’t any games on any given day, so I know that data was actually fetched. I created some boolean properties to handle this.
Tomorrow, I’ll start working on the UI, since most of the data handling is covered for now. I’m sure I’ll have to modify it along the way, but, this should do for now.