Help with Journal App - My modified version

I’m doing an app to track livestock and I’m using more or less the same type of model as the Journal app. I just referenced the video and I see where I have to create a new Note (or in this case a new Animal) by saying: let n = animal(animalID = UUID, animalName = animalNameText.text, etc…

My question is - in lessons past it seems like the format for setting properties is like I have laid out below. So I am confused as to what the practical difference is in the code above versus the code below. The code below doesn’t work - the Animal object still is nil afterward.

@IBAction func saveNoteButton(_ sender: Any) {

    print ("Button pushed")
    //need an if statement in here if animal.indexpath.row is nil... then set a value to a
    //also create the unique identifier field
    if animal == nil {
        print ("This is a blank animal record.  need to save what's in the fields.")
        animal?.animalName = animalNameText.text!
        animal?.animalType = animalTypeText.text!
        animal?.dateBirth = dobText.text!
        animal?.animalDescription = descriptionText.text!
        animal?.dateAquired = dateAquiredText.text!
        animal?.dam = damText.text!
        animal?.sire = sireText.text!
        animal?.sex = sexText.text!
        animal?.notes = notesText.text!
        animal?.weenDate = weenDateText.text!
        animal?.animalBreed = breedText.text!
        animal?.animalID = "123445"
    print (animal!)
    saveNote(a: animal!)

Where is the animal object defined??

You’re setting values equal to a variable, which I’m surprised it’s still nil afterwards. Is animal nil, or animal.animalName (or any other property) have a value in it?

You should be creating a new animal object and then saving that object