Hello, This is for a JP Morgan Chase Take home quiz for an iOS developer role.
There are two parts to this test:
- take this JSON data with NYC high school SAT scores (https://data.cityofnewyork.us/resource/f9bf-2cp4.json) and put it into a table.
- when a user clicks on a school from this table they should be able to view statistics on the SAT scores about said school (SAT statistics in the same JSON call from part 1).
- to accomplish part one of this test I used this YouTube video titled "How To Pass API Data To TableView Cells In Swift IOS" (https://www.youtube.com/watch?v=0H78ktM97yU&t=646s) to make a table with all the schools in the JSON file. Here is my code that is the same as this video except with the API of the schools instead of the API from the YouTube video.
- to accomplish the second part of this test I found this YouTube video (https://www.youtube.com/watch?v=samoIVHg6yQ&t=533s) on expandable tables. This is where I am struggling though. I figured it wouldn't be hard to take the code from this YouTube video and implement it into the code I made from the YouTube video I used for part one.... but... I was soooo wrong. Here is the code from this YouTube video
My first thought on how to implement the code from the "Creating Expandable TableView Cells (Collapsable) - Xcode 12, Swift 5, iOS Development 2022" YouTube video into the code I made from the "How To Pass API Data To TableView Cells In Swift IOS" was to edit the Model.swift file in my code. However, when I do that I get an error from Xcode saying "Return from initializer without initializing all stored properties" cuz I added in the 'init' subclass (I think that is what it is called). Then I tried to edit the model again and I didn't get an error, but this time my emulator just doesn't show any code...?
Does anyone have any advice on how to get this code to work? In case this is confusing, here is an image of what I have now and what I am trying to accomplish in my readme along with the prompt I got from JPMC.
(also-- I already got rejected for this role 2 weeks ago bc I failed the test, but now I am trying to figure out how to solve it anyways for my own learning development, so you're not helping me 'cheat' by helping me with this. I just want to learn how to get APIs to work cuz I know how important that is for iOS jobs)
PS: sorry for the wonky formatting Apple forums don't allow you to post YouTube videos or JSON files so I had to get crafty.