[CS] CS50 Tracks: iOS

Penny Ng
3 min readJan 6, 2021

Finally, I finished this eight-week course. As an iOS developer, naturally I chose iOS track.

Assignment 1: Pokedex

Specs:

Add searching function.

Add a button to keep track of which Pokémon have been caught and save the state in UserDefaults.

Create structs with types that match the keys and types returned by the API. Parse the JSON data and display Pokemons’ image and description

Some structs are added to help parse the JSON data. I have done some practices of this skill in Music App, so it didn’t take me much time to finish the parts of displaying pokemon image and description.

To keep track of the state if a pokemon is caught or not, I save their names as keys and a bool value as their values in UserDefaults.

Assignment 2: Fiftygram

Specs:

Add a filter

Add the function of saving photos

I add a bar button item Save Photo and implement UIImageWriteToSavedPhotosAlbum to save the image. An alert will pop up after pressing Save Photo to notify the user whether the photo is saved successfully or not.

Assignment 3: Notes

Specs:

Add the function of deleting notes.

I implement delete function in both NotesListViewController and NoteViewController. User can swipe on a note from the list to delete it, just like the swipe-and-delete function in the group order app I made.

User can delete a note by pressing the delete button in NoteViewController as well. I use self.navigationController?.popViewController(animated: true) to let it go back to NotesListViewController.

I have no experience of dealing with sqlite3, so basically how I handle it is copying the scripts from saveNote and getNotes functions and then modifying the SQL command.

--

--

Penny Ng

A passionate self-taught  iOS developer. Write to record my learning and share the knowledge