We only have one new data model, much like the previous chapter. In this case, we need to create a model for an image note.
Like the audio note we defined in the previous project, we will be inheriting the functionality from BaseNote
for the image note. This is what the model looks like:
Like the audio note, there's not a lot that needs to be done because the BaseNote
class does most of our work. Let's go over the changes:
A
camera
property will store a reference to aCameraManager
instance. We'll define this in the next section; it lets us talk to the Camera API. It serves the same purpose as themedia
property on an audio note._updateModificationDate
will update the modification date after an image is taken.getFormattedUnitValue
will override the version ofBaseNote
. To make things a little easier to read, we'll convert the file size to kilobytes or megabytes if the file is large enough (rather than...