There have been an increasing number of news stories about border patrol agents refusing to let people in or out of the country without giving them access to their phones. Despite the fact that this is almost certainly a violation of the 4th and 5th Amendment, it seems that some branches of our government don't appear to be operating within the law any longer.
Sure, you can refuse to hand them your phone, and theoretically they'll eventually have to let you go, but no one wants to go through that. My recommendation? Wipe your phone before crossing the border. You can easily restore it from iCloud once you're safely over the border and back on wifi.
Be sure you don't have boarding passes or other information you need access to stored on your phone before you wipe it!
- First, make sure your phone is backed up. Go to Settings > iCloud > Backup and make sure a recent date is listed. If not, tell it to back up now. Be sure to do this before you leave for your trip, as it will need a wifi network and a chunk of time to back it up.
- As you approach the border, now is the time to wipe your phone. First, sign out of iCloud. Go to Settings > iCloud > Sign Out. Otherwise, your device might remain in Activation Lock (not the end of the world, since you're simply going to restore it).
- Now to wipe it. Go to Settings > General > Reset. Then tap Erase All Content and Settings.
Your phone is now blank, exactly as when you first bought it. Due to the security measures Apple has in place, no data can be recovered from an iOS device once it's erased in this manner. You're likely to incur some extra questions from border patrol, but at least you won't have to give them access to everyone you know, everything you do, and everywhere you've been.
Once you're at your destination and on wifi, simply sign into your iCloud account and restore from a backup when prompted.