Suppose you find a lost iPhone. Because you are a person of strong moral fibre and good character, you want to help the poor, heartbroken multitouch devotee who pines for this misplaced device.

So all you have to do is just figure out who owns the phone, get it back to the grateful owner and feel the warm glow that comes from having done a good deed for the day.

Sounds pretty basic, right? Sometimes, it can be, but often getting a misplaced iOS device back to its rightful owner can be a lot more complicated than it sounds, especially if the phone has a passcode lock in place. How to do the right thing when security measures stand in your way?

We'll tackle some of the steps you can take should that scenario occur. But first, let's handle the easier situation.

If you find an iPhone without a passcode

Unsecured iPhones are easier to return.

To return the iPhone to its rightful owner, your first step will be figuring out that owner's name. You could look up the phone's number and call it and listen to the voicemail, but an easier option may involve launching the Mail app. Launch Mail, and tap into a message.

Unfortunately, this will work better with a message that looks like it's more personal than, say, an email newsletter or other bulk message. If you see Details at the upper right of the message you're looking at, opposite the From name, tap it. Now, you should see the To line, which should include your phone owner's name.

Tapping on the recipient's name should open their own personal Contacts record, which may well contain other phone numbers, email addresses, and other details. You can use any of that information to contact the phone's owner.

If you feel uncomfortable tapping into the stranger's inbox to find his or her identity, there's a longer approach. Where you fall on the convenience vs effort-required-to-assist-a-stranger axis is a personal decision.

The longer route: Launch the Phone app and tap on Contacts. Pull down to swipe above the alphabetised A section, above the search box, and you'll see the owner's phone number. Memorise or jot down the number, and then tap the keypad icon to start dialling the number as if you wanted to call the phone itself. The number vanishes when you tap into the Search field, but you can cancel your search to see the number again.

After you tap in the number, even before you tap to place the call, the owner's name should appear below the number. At that point, you can find that name in the Contacts list and then use alternative numbers or email addresses to reach out to the person.

It's possible that the owner won't have a personal record in the iPhone's address book. That makes your job tougher. Now, the easiest thing to do might be to tap on Recents and look at frequently listed numbers. Trying one of them may put you in contact with someone who can help you find the owner. You can also use the Mail app to email the owner by looking at the From address you're sending from, and sending a message to that same address.

One final option is to search the Contacts list for the word ICE, often written in all caps. ICE, an acronym for In Case of Emergency, is a label that folks sometimes add to their emergency contacts. First responders and hospitals know to look for such contacts and reach out to them if a phone's owner is unable to do so. The emergency contact should be well equipped to put you in contact with the phone's owner.

If you find a locked iPhone

This is a much trickier situation. Since you can't unlock the phone, you can't poke around in the manner described above to find the owner's contact information. But you do have options.

The first is to hold down the Home button for a few seconds which may, depending on the owner's phone settings, trigger either Siri or Voice Control. In either case, when prompted by the beep, say, "Call ICE." If the phone's owner has an ICE contact as described above, the phone will either start calling that person right away or ask you to clarify which number to call (as in Home, Mobile, Work, etc). If you luck out and connect with the emergency contact, you can explain the situation to that person.

If it's an iPhone 4S and the owner hasn't changed the privacy settings, you can try speaking a few of Siri's more advanced options to find people close to the owner, too: "Call my wife," "Call my husband," "Call my sister," "Call my father" and the like just might work.

But if the phone won't listen, or if the phone listens and still can't help you, you're not completely out of luck. Unfortunately, however, neither Apple nor the carrier associated with the phone will likely be able to help you find the owner, thanks to privacy restrictions on sharing the third party's personal data.

That leaves just one option: wait. If you can, plug the phone in on occasion to keep it running and online. The owner may well try to call the phone, or a friend might. And if you keep the phone powered on, there's a chance the original owner will use Find My iPhone to send a message with contact information to the phone's screen.