LibraryDetailViewController
class LibraryDetailViewController : UIViewController, UIScrollViewDelegate
Undocumented
-
An object that manages the array of
Plant
objects.Declaration
Swift
var plantsManager: PlantsManager!
-
Row being edited by the user.
Todo
make privateDeclaration
Swift
var editingRowIndex: Int?
-
An object that managers the editing row.
Todo
make privateDeclaration
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 privateDeclaration
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 privateDeclaration
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 privateDeclaration
Swift
var assetTracker: AssetIndexIDTracker
-
Blur effect for the header image.
Todo
Can this be moved to theView
?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 privateDeclaration
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 withshouldDelete
set totrue
.Todo
make privateDeclaration
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 moreDeclaration
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 toUIColor.label
.Todo
make privateDeclaration
Swift
func setNotesTextView(to textViewState: TextViewState)
-
Set up the text view with the notes of a
Plant
objectTodo
make privateDeclaration
Swift
func setupNotesView()
-
Set up the
KeyboardObserver
object.Todo
make privateDeclaration
Swift
func setupKeyboardObserver()
-
Set a tap gesture to hide the keyboard.
Todo
make privateDeclaration
Swift
func hideKeyboardWhenTappedAround()
-
Dismiss the keyboard by calling
view.endEditing(true)
.Todo
Write a quick tutorial for usingKeyboardObserver
for my website.Todo
make privateDeclaration
Swift
@objc func dismissKeyboard()
-
Add an image for the plant.
Todo
make privateDeclaration
Swift
@objc func addImages(_ alert: UIAlertAction)
-
Called when the user is done selecting images. It checks for a new header image and calls the library view controller to set the icon.
Declaration
Swift
func didFinishSelecting(assetPicker: PlantAssetsPickerViewController)
-
Undocumented
Declaration
Swift
override func prepare(for segue: UIStoryboardSegue, sender: Any?)