Last active
July 18, 2020 07:37
-
-
Save LinnierGames/7c47c8ffbfc5db008adea2b4ad4421cb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol SchoolServiceDelegate: AnyObject { | |
func schoolServiceDidFinishFetching(_ service: SchoolService) | |
} | |
class SchoolService { | |
weak var delegate: SchoolServiceDelegate? | |
private(set) var nycHSList: [NYCHighSchool] = [] | |
func fetchHighschoolStuff() { | |
// Move the code from fetchNYCHighSchoolInformation here (fetch, decode data into NYCHighSchool models, update nycHSList) | |
// Try using JSONDecoder() instead of JSONSerialization | |
// When finished, update nycHSList and notify the delegate | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment