Skip to content

Commit

Permalink
update per @Cierpliwy for iOS 11.2 logic
Browse files Browse the repository at this point in the history
  • Loading branch information
mutablestudio committed Sep 9, 2019
1 parent 720ca95 commit 32b40cc
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions ios/RxBluetoothKit/RxCBPeripheral.swift
Original file line number Diff line number Diff line change
Expand Up @@ -362,12 +362,14 @@ class RxCBPeripheral: RxPeripheralType {

@objc func peripheralIsReady(toSendWriteWithoutResponse peripheral: CBPeripheral) {
//resolve build errors with XCode 11 / iOS 13
var sendStatus = false
if #available(iOS 11.0, *) {
sendStatus = peripheral.canSendWriteWithoutResponse
let canSendWriteWithoutResponse: Bool
if #available(iOS 11.2, *) {
canSendWriteWithoutResponse = peripheral.canSendWriteWithoutResponse
} else {
canSendWriteWithoutResponse = true
}
RxBluetoothKitLog.d("\(peripheral.logDescription) peripheralIsReady(toSendWriteWithoutResponse:\(sendStatus)")
peripheralIsReadyToSendWriteWithoutResponseSubject.onNext(sendStatus)
RxBluetoothKitLog.d("\(peripheral.logDescription) peripheralIsReady(toSendWriteWithoutResponse:\(canSendWriteWithoutResponse)")
peripheralIsReadyToSendWriteWithoutResponseSubject.onNext(canSendWriteWithoutResponse)
}
}

Expand Down

0 comments on commit 32b40cc

Please sign in to comment.