A simple, block-based, lightweight Objective-C wrapper library for Apple's CoreBluetooth framework.
LGBluetooth is an open-source Objective-C library that wraps Apple's CoreBluetooth framework with a block-based API. It solves the problem of CoreBluetooth's complex delegate pattern and scattered method calls by providing a clean, hierarchical interface for Bluetooth Low Energy operations. The library simplifies connecting to peripherals, discovering services and characteristics, and reading/writing values while maintaining full access to underlying BLE functionality.
iOS developers working with Bluetooth Low Energy (BLE) who need to interact with BLE peripherals in their Objective-C or Swift applications. Particularly useful for developers frustrated with CoreBluetooth's delegate complexity.
Developers choose LGBluetooth because it dramatically reduces the boilerplate and callback complexity of CoreBluetooth while remaining lightweight. Its block-based API makes BLE code more readable, maintainable, and less error-prone compared to raw CoreBluetooth implementations.
Simple, block-based, lightweight library over CoreBluetooth. Will clean up your Core Bluetooth related code.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Replaces CoreBluetooth's delegate pattern with completion blocks for all operations, as shown in the scanForPeripheralsByInterval and connectWithCompletion examples, making code more readable and reducing callback nesting.
Handles connection management and service/characteristic discovery hierarchically, like in the testPeripheral method, which sequentially connects, discovers services, and characteristics to avoid messy delegate callbacks.
Provides a thin abstraction over CoreBluetooth without hiding functionality, allowing developers to maintain control while benefiting from a cleaner interface, as emphasized in the library's philosophy.
Includes LGUtils class for basic read/write operations that automatically manage connections, simplifying common tasks like reading from or writing to characteristics without manual connection handling.
The library is written in Objective-C, which can lead to integration challenges in Swift projects and doesn't leverage modern Swift features like async/await or Combine.
Lacks updates for newer iOS Bluetooth features or Swift concurrency, forcing developers to rely on block-based patterns even as Apple evolves its frameworks.
The README provides basic examples but lacks comprehensive API documentation, advanced usage guides, or troubleshooting tips, which can hinder deeper implementation.