Running two instances of an app but have them connected to each other

Hello so here is my issue... I am developing an app in Xcode and my app has a driver side and rider side. My goal is to have the driver and rider communicate in real time by passing data between view controller. For example, when driver is online rider can read driver's location and generate an annotation on rider's screen. Okay so here is my question, how can I connect two instances of the app when each instance is running as driver and rider respectively. Sorry if the wording is confusing and hard to comprehend.

Replies

I assume you mean with at least two devices? How will they be connected?