I'm not sure how to construct the question in a much more proper way, and there are quite similar questions but they don't exactly give me an answer.

What I wanna do is pretty much simple. I have a model:

```
struct Person: Codable {

...
    // And I have a func, or let's put it in an extension:

    func isEqual(to person: Person?) -> Bool {
      return self.id == person?.id
    }

}

```

And it's used like this, no brainer:

```
let person1: Person!
let person2: Person?
person1.isEqual(to: person2)

```

But I need the function to accept the first object as optional, like so:

```
let person1: Person?
let person2: Person?
person1?.isEqual(to: person2)

```

So question is, how to make such function accepts a first object as optional?