PlantsManager

class PlantsManager

A manager of the fundamental plant objects for the app. It loads, saves, and adds plants to the array plants: [Plant]. This manager should be created at start-up and passed to various view controllers.

  • The central array that holds all of the Plant objects for the user.

    Declaration

    Swift

    var plants: [Plant]
  • Loads the plants into plants: [Plant]

    Declaration

    Swift

    init()
  • Loads the plants from disk. It is already called during initialization.

    Declaration

    Swift

    func loadPlants()
  • Save the plants to disk.

    Declaration

    Swift

    func savePlants()
  • Make a new plant with nil for scientific and common names and append to plants: [Plant].

    Declaration

    Swift

    func newPlant()
  • Makes a test array of plants for use during development.

    Declaration

    Swift

    func makeTestPlantsArray()