Swiftpack.co -  StarryInternet/CombineCoreBluetooth as Swift Package
Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
A wrapper API for CoreBluetooth using Combine Publishers
.package(url: "https://github.com/StarryInternet/CombineCoreBluetooth.git", from: "0.1.2")


CI GitHub

CombineCoreBluetooth is a library that bridges Apple's CoreBluetooth framework and Apple's Combine framework, making it possible to subscribe to perform bluetooth operations while subscribing to a publisher of the results of those operations, instead of relying on implementing delegates and manually filtering for the results you need.


  • iOS 13, tvOS 13, macOS 10.15, or watchOS 6
  • Xcode 12 or higher
  • Swift 5.3 or higher


This library is heavily inspired by pointfree.co's approach to designing dependencies, but with some customizations. Many asynchronous operations returns their own Publisher or expose their own long-lived publisher you can subscribe to. To do something like fetching a value from a characteristic, for instance, you could call the following methods on the Peripheral type and subscribe to the resulting Publisher:

// use whatever ids your peripheral advertises here
let serviceID = CBUUID(string: "0123")
let characteristicID = CBUUID(string: "4567")

  .readValue(forCharacteristic: characteristicID, inService: serviceID)
  .sink(receiveCompletion: { completion in
    // handle any potential errors here
  }, receiveValue: { data in
   // handle data from characteristic here, or add more publisher methods to map and transform it.
  .store(in: &cancellables)

The Peripheral type (created and given to you by the CentralManager type) here will filter the results from the given delegate methods, and only send values that match the service and characteristic IDs down to subscribers or child publishers.


All major types from CoreBluetooth should be available in this library, wrapped in their own types to provide the Combine-centric API. This library has been tested in production for most CentralManager related operations. Apps acting as bluetooth peripherals are also supported using the PeripheralManager type, but that side hasn't been as rigorously tested.


Stars: 28
Last commit: 5 hours ago

Ad: Job Offers

iOS Software Engineer @ Perry Street Software
Perry Street Software is Jack’d and SCRUFF. We are two of the world’s largest gay, bi, trans and queer social dating apps on iOS and Android. Our brands reach more than 20 million members worldwide so members can connect, meet and express themselves on a platform that prioritizes privacy and security. We invest heavily into SwiftUI and using Swift Packages to modularize the codebase.

Submit a free job ad (while I'm testing this). The analytics numbers for this website are here.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics