Skip to content

Commit

Permalink
Merge pull request #49 from jordanebelanger/swift5.5
Browse files Browse the repository at this point in the history
Fix swift 5.5 related issues
  • Loading branch information
jordanebelanger authored Oct 29, 2021
2 parents e9e9345 + b2e5e80 commit e206fbe
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.0
// swift-tools-version:5.5
import PackageDescription

let package = Package(
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ NotificationCenter.default.addObserver(forName: Central.CentralManagerWillRestor
Add this to your Podfile:

```ruby
pod 'SwiftyBluetooth', '~> 2.1.0'
pod 'SwiftyBluetooth', '~> 3.0.0'
```
### Swift Package Manager
Simply add the library to your xcode project as a "Package Dependency"
Expand Down
4 changes: 2 additions & 2 deletions Sources/CBUUIDPath.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ extension CBService {

extension CBCharacteristic {
var uuidPath: CBUUIDPath {
return characteristicPath(service: self.service, characteristic: self)
return characteristicPath(service: self.service!, characteristic: self)
}
}

extension CBDescriptor {
var uuidPath: CBUUIDPath {
return descriptorPath(service: self.characteristic.service, characteristic: self.characteristic, descriptor: self)
return descriptorPath(service: self.characteristic!.service!, characteristic: self.characteristic!, descriptor: self)
}
}
16 changes: 8 additions & 8 deletions Sources/Peripheral.swift
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ extension Peripheral {
completion: @escaping DescriptorRequestCallback)
{
self.discoverDescriptors(ofCharacWithUUID: charac,
fromServiceWithUUID: charac.service,
fromServiceWithUUID: charac.service!,
completion: completion)
}

Expand All @@ -240,7 +240,7 @@ extension Peripheral {
completion: @escaping ReadCharacRequestCallback)
{
self.readValue(ofCharacWithUUID: charac,
fromServiceWithUUID: charac.service,
fromServiceWithUUID: charac.service!,
completion: completion)
}

Expand Down Expand Up @@ -272,8 +272,8 @@ extension Peripheral {
completion: @escaping ReadDescriptorRequestCallback)
{
self.readValue(ofDescriptorWithUUID: descriptor,
fromCharacUUID: descriptor.characteristic,
ofServiceUUID: descriptor.characteristic.service,
fromCharacUUID: descriptor.characteristic!,
ofServiceUUID: descriptor.characteristic!.service!,
completion: completion)
}

Expand Down Expand Up @@ -310,7 +310,7 @@ extension Peripheral {
completion: @escaping WriteRequestCallback)
{
self.writeValue(ofCharacWithUUID: charac,
fromServiceWithUUID: charac.service,
fromServiceWithUUID: charac.service!,
value: value,
type: type,
completion: completion)
Expand Down Expand Up @@ -347,8 +347,8 @@ extension Peripheral {
completion: @escaping WriteRequestCallback)
{
self.writeValue(ofDescriptorWithUUID: descriptor,
fromCharacWithUUID: descriptor.characteristic,
ofServiceWithUUID: descriptor.characteristic.service,
fromCharacWithUUID: descriptor.characteristic!,
ofServiceWithUUID: descriptor.characteristic!.service!,
value: value,
completion: completion)
}
Expand Down Expand Up @@ -385,7 +385,7 @@ extension Peripheral {
{
self.setNotifyValue(toEnabled: enabled,
forCharacWithUUID: charac,
ofServiceWithUUID: charac.service,
ofServiceWithUUID: charac.service!,
completion: completion)
}

Expand Down
16 changes: 8 additions & 8 deletions Sources/PeripheralProxy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ private final class DescriptorRequest {
init(characteristic: CBCharacteristic, callback: @escaping DescriptorRequestCallback) {
self.callback = callback

self.service = characteristic.service
self.service = characteristic.service!
self.characteristic = characteristic
}

Expand Down Expand Up @@ -508,7 +508,7 @@ private final class ReadCharacteristicRequest {
init(characteristic: CBCharacteristic, callback: @escaping ReadCharacRequestCallback) {
self.callback = callback

self.service = characteristic.service
self.service = characteristic.service!
self.characteristic = characteristic
}

Expand Down Expand Up @@ -598,8 +598,8 @@ private final class ReadDescriptorRequest {
self.callback = callback

self.descriptor = descriptor
self.characteristic = descriptor.characteristic
self.service = descriptor.characteristic.service
self.characteristic = descriptor.characteristic!
self.service = descriptor.characteristic!.service!
}

}
Expand Down Expand Up @@ -690,7 +690,7 @@ private final class WriteCharacteristicValueRequest {
self.value = value
self.type = type
self.characteristic = characteristic
self.service = characteristic.service
self.service = characteristic.service!
}

}
Expand Down Expand Up @@ -797,8 +797,8 @@ private final class WriteDescriptorValueRequest {
self.callback = callback
self.value = value
self.descriptor = descriptor
self.characteristic = descriptor.characteristic
self.service = descriptor.characteristic.service
self.characteristic = descriptor.characteristic!
self.service = descriptor.characteristic!.service!
}
}

Expand Down Expand Up @@ -888,7 +888,7 @@ private final class UpdateNotificationStateRequest {
init(enabled: Bool, characteristic: CBCharacteristic, callback: @escaping UpdateNotificationStateCallback) {
self.enabled = enabled
self.characteristic = characteristic
self.service = characteristic.service
self.service = characteristic.service!
self.callback = callback
}
}
Expand Down
2 changes: 1 addition & 1 deletion SwiftyBluetooth.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'SwiftyBluetooth'
s.version = '2.2.1'
s.version = '3.0.0'
s.license = 'MIT'
s.homepage = 'https://github.com/jordanebelanger/SwiftyBluetooth'
s.authors = { 'Jordane Belanger' => '[email protected]' }
Expand Down
4 changes: 3 additions & 1 deletion SwiftyBluetooth.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
096409A51CC6103D00ADD4D9 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1200;
LastUpgradeCheck = 1310;
TargetAttributes = {
096409AD1CC6103D00ADD4D9 = {
CreatedOnToolsVersion = 7.3;
Expand Down Expand Up @@ -222,6 +222,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down Expand Up @@ -282,6 +283,7 @@
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1200"
LastUpgradeVersion = "1310"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down

0 comments on commit e206fbe

Please sign in to comment.