Giter Club home page Giter Club logo

playlist2.0's Introduction

PlaylistUserDefaults is designed to help have students practice converting model objects to dictionaries and persisting data using UserDefaults.

Look over the README in the root folder of this repository

Suggested breakdown for PlaylistUserDefaults

Start this project from Playlist (the version without persistence), not from scratch

  1. Show students the final product first so they know what they are working toward.
  2. Take a few minutes to go over the version without persistence and make sure everyone understands things like prepare(for segue: UIStoryboardSegue, sender: Any?).
  3. Have students look at UserDefaults documentation and discuss with each other how it works and what objects it can store. This should help them reinforce the idea that you cannot store your custom objects "as-is".
  4. Plan out the new methods you will need to store and load data.
  5. Go to your Song object and create a computed property that will convert it into a dictionary.
  6. Create a failable initializer for your Song object that will take a dictionary and convert it into a Song instance.
  7. Repeat the last two steps for your Playlist object.
  8. Fill out your saveToPersistentStore() function, referencing documentation for the UserDefaults functions.
  9. Determine where in the project you need to call saveToPersistentStore() and add the call(s).
  10. Fill out your loadFromPersistentStore() function, referencing documentation for the UserDefaults functions.
  11. Determine where in the project to load your data, and call loadFromPersistentStore(). Everyone's app should work now.

playlist2.0's People

Contributors

swoop12 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.