Apple secured patent on how you can back up your data if you have no internet signal by using your friends iPhone.
According to the patent it works if your iPhone can't connect to the internet for some reason, then it will search for nearby iPhones with the same WiFi network, as well as via Bluetooth and NFC.
If your iPhone detects that someone you know is nearby (using your contacts or a pre-approved buddy list) then it will send them a notification. Your friend can then choose to help you back up your data by temporarily transferring it to their iPhone. Any photos or notes that weren't already saved to your iCloud account will be encrypted and sent to your friend, whose phone will then back them up for you.
Apple's patent also says that your data will expire after enough time, so there's a smaller risk of someone gaining access to your data. The patent suggests one week as an example of how long your data might sit on someone else's iPhone
Just because Apple has patented something doesn't mean that it's actually going to happen. It patents lots of different ideas and systems, but only releases a very small amount as actual product.
An Apple patent could also be used to stop its rivals developing something, or as a marketing tool.