The Multipeer Connectivity framework was added in iOS 7 and provides a layer on top of the Bonjour protocol. You can communicate with apps running on nearby devices. Under the hood, the framework automatically chooses a suitable networking technology:
- Wi-Fi network if both devices are on the same Wi-Fi network
- Peer-to-peer Wi-Fi (supported on iOS devices with a Lighting Connector and on Macs since 2012)
- Bluetooth
A working example of Multipeer connectivity Framework. Need two devices to Test.