LibraryDetailViewController

class LibraryDetailViewController : UIViewController, UIScrollViewDelegate

Undocumented

  • Plant object being displayed.

    Declaration

    Swift

    var plant: Plant!
  • An object that manages the array of Plant objects.

    Declaration

    Swift

    var plantsManager: PlantsManager!
  • Row being edited by the user.

    Todo

    make private

    Declaration

    Swift

    var editingRowIndex: Int?
  • An object that managers the editing row.

    Todo

    make private

    Declaration

    Swift

    var editManager: EditPlantLevelManager?
  • The parent library view controller delegate.

    Declaration

    Swift

    var containerDelegate: LibraryDetailContainerDelegate!
  • The main view of the LibraryDetailViewController.

    Declaration

    Swift

    var libraryDetailView: LibraryDetailView!
  • The view controller for the table view showing the general plant information.

    Declaration

    Swift

    let generalInfomationViewController: GeneralPlantInformationTableViewController
  • The view controller for the table view showing the links to reliable sources.

    Declaration

    Swift

    let linksTableViewController: LinksTableViewController
  • An object for managing the keyboard notifications.

    Note

    This object is from the swift package ‘KeyboardObserver’.

    Todo

    make private

    Declaration

    Swift

    let keyboard: <<error type>>
  • The starting off-set for the scroll view for the parallax feature.

    Note

    This is a bit of a hack and can definitely be improved. That said, it works…

    Todo

    Make this private.

    Declaration

    Swift

    var startingYOffset: CGFloat?
  • A notification to the parent view controller for whether to delete this plant when return to library.

    Todo

    Make this private(set) so cannot be changed by other, but can be seen.

    Declaration

    Swift

    var shouldDelete: Bool
  • A boolean value for whether the header image of the detail view was set.

    Todo

    make private

    Declaration

    Swift

    var headerImageIsSet: Bool
  • A manager of the assets (images) being loaded from the user’s library.

    This manages the assets during active selection of the images in the image picker. When an image is selected, it is downloaded. When an image is unselected, it is removed. When the user either saves or cancels, the manager has the list of images to ensure are saved or deleted.

    Todo

    make private

    Declaration

    Swift

    var assetTracker: AssetIndexIDTracker
  • Blur effect for the header image.

    Todo

    Can this be moved to the View?

    Declaration

    Swift

    var blurEffectView: UIVisualEffectView!
  • Undocumented

    Declaration

    Swift

    override func viewDidLoad()
  • Undocumented

    Declaration

    Swift

    override func viewWillAppear(_ animated: Bool)
  • Gets the header image for the plants.

    Declaration

    Swift

    func getHeaderImage() -> UIImage?

    Return Value

    The best option for the header image of a plant.

  • Adjust the view for vertical scrolling.

    Declaration

    Swift

    func scrollViewDidScroll(_ scrollView: UIScrollView)
  • An action sheet is presented when the Edit navigation bar button is tapped.

    Todo

    make private.

    Declaration

    Swift

    @objc
    func editDetailAction()
  • Push to the collection view of all the plants images.

    Todo

    make private

    Declaration

    Swift

    func pushImageCollectionView(_ alert: UIAlertAction)
  • A second check that the user wants to delete the plant from their library. Selecting Remove pops back to the plant library with shouldDelete set to true.

    Todo

    make private

    Declaration

    Swift

    func removeFromLibrary(_ alert: UIAlertAction)
  • Adjusting the information view based on the selectino of the segmented controller.

    Note

    This object is from the swift package ‘TwicketSegmentedControl’.

    Todo

    For iOS 13, change to standard segmented controller.

    Declaration

    Swift

    func didSelect(_ segmentIndex: Int)
  • The text view is either blank or has content.

    See more

    Declaration

    Swift

    enum TextViewState
  • If the text view is blank, grey text is added to indicate that the user can add Notes. Otherwise, the text color is set to black.

    Todo

    for iOS 13, update to UIColor.label.

    Todo

    make private

    Declaration

    Swift

    func setNotesTextView(to textViewState: TextViewState)
  • Set up the text view with the notes of a Plant object

    Todo

    make private

    Declaration

    Swift

    func setupNotesView()
  • Set up the KeyboardObserver object.

    Todo

    make private

    Declaration

    Swift

    func setupKeyboardObserver()
  • Set a tap gesture to hide the keyboard.

    Todo

    make private

    Declaration

    Swift

    func hideKeyboardWhenTappedAround()
  • Dismiss the keyboard by calling view.endEditing(true).

    Todo

    Write a quick tutorial for using KeyboardObserver for my website.

    Todo

    make private

    Declaration

    Swift

    @objc
    func dismissKeyboard()
  • Add an image for the plant.

    Todo

    make private

    Declaration

    Swift

    @objc
    func addImages(_ alert: UIAlertAction)
  • Undocumented

    Declaration

    Swift

    override func prepare(for segue: UIStoryboardSegue, sender: Any?)