Core Bluetooth: The Central vs. Peripheral Model

Core Bluetooth lets your app talk to BLE devices by acting as a "Central" (scanner) or "Peripheral" (advertiser). Use it to read from sensors or make your app discoverable.
WHY IT EXISTS Bluetooth is a vast, complex standard. Core Bluetooth provides a focused Swift/Objective-C API for one specific part: Bluetooth Low Energy (BLE). It abstracts away the low-level radio signaling to let apps communicate with power-efficient IoT devices like sensors, trackers, and smart appliances.
THE MENTAL MODEL View Core Bluetooth through its two main roles: Central and Peripheral. A Central (typically your iPhone app) scans for and connects to Peripherals. A Peripheral (a heart rate monitor, a smart lock, or even another phone) advertises its services and waits for a Central to connect. This is a client-server model, but for local, low-power device-to-device communication.
HOW IT WORKS Communication is structured around the Generic Attribute Profile (GATT). A Peripheral advertises "Services" (e.g., a "Heart Rate Service"). Each Service contains one or more "Characteristics" (e.g., a "Heart Rate Measurement" value). A Central discovers these services and characteristics, then can read, write, or subscribe to them. Subscribing is key: the Peripheral notifies the Central whenever a characteristic's value changes, avoiding the need for constant polling. Your code will primarily use CBCentralManager to act as a Central and CBPeripheralManager to act as a Peripheral.
WHEN TO USE IT Use Core Bluetooth when your app needs to communicate with BLE hardware. This includes fitness trackers, medical devices, smart home gadgets, proximity beacons (like iBeacon), and any custom hardware using BLE for low-power data transfer. It's also used for direct communication between two Apple devices without a Wi-Fi network.
WHEN NOT TO USE IT Do not use Core Bluetooth for high-bandwidth data streaming like audio or video; use specific Bluetooth profiles like A2DP or other technologies like Wi-Fi Direct. It is not for managing system-level connections to keyboards or headphones. Higher-level frameworks like Multipeer Connectivity may be simpler for peer-to-peer data exchange between Apple devices.
ONE CANONICAL EXAMPLE An app for a smart glucose meter. The app acts as a Central, scanning for the meter (a Peripheral). Once connected, it discovers the "Glucose Service." It then subscribes to the "Glucose Measurement" characteristic. When the meter takes a new reading, it updates the characteristic, and Core Bluetooth notifies the app with the new value, which the app then displays and logs.
Read the original → developer.apple.com
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.