Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS 15 support #401

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

chamira-at
Copy link

There are some changes to the Core Bluetooth API.

CBService
unowned(unsafe) var peripheral: CBPeripheral { get }

CBCharacteristic
unowned(unsafe) var service: CBService { get }

CBDescriptor
unowned(unsafe) var characteristic: CBCharacteristic { get }
iOS 15.X

CBService
weak var peripheral: CBPeripheral? { get }

CBCharacteristic
weak var service: CBService? { get }

CBDescriptor
weak var characteristic: CBCharacteristic? { get }

The changes are detailed describe here in this issue

Solution:

Made below classes' convenience init(…) methods optional convenience init?(…) and only initialize if pass in params required properties(service, characteristic, descriptors) are not deallocated.

RxBluetoothKit

- Characteristic.swift
- Descriptor.swift

Example

    convenience init?(descriptor: CBDescriptor, peripheral: Peripheral) {

        guard let _characteristic = descriptor.characteristic, let _service = _characteristic.service else {
            return nil
        }

        let service = Service(peripheral: peripheral, service: _service)
        let characteristic = Characteristic(characteristic: _characteristic, service: service)
        self.init(descriptor: descriptor, characteristic: characteristic)
    }

Caller sites have been always guard strogeRefeance therefore, added an extra guard for those that are optionally initializable.

Test

Test cases are update and force unwrapped for those optional initializable objects.

Other improvement

Fixed deprecated method signature warnings.

There are some changes to the CoreBluetooth API. Specially to the memory managment
Details are described here
Polidea#398
@CLAassistant
Copy link

CLAassistant commented Sep 2, 2021

CLA assistant check
All committers have signed the CLA.

@chamira-at chamira-at marked this pull request as ready for review September 3, 2021 07:34
@CSolanaM
Copy link

CSolanaM commented Sep 23, 2021

Thank you very much @chamira-at for this PR. A dependency of my project depends on this to unblock me of using the latest Swift version. Looking forward for @robnadin 's review.

@gudlaugurellert
Copy link

Likewise @CSolanaM ! Friendly nudge @robnadin ;)

@robnadin
Copy link
Contributor

Likewise @CSolanaM ! Friendly nudge @robnadin ;)

Unfortunately I don't have write access so I'm not able to perform a full review, just thought I'd add my $0.02 to the changes 🙃

@gudlaugurellert
Copy link

@minixT friendly nudge! Is there any chance you could have a look at this PR?

@MishkaBalu
Copy link

can you please have a look on this PR ?

@chamira-at
Copy link
Author

@monikamsc Can you please help us reviewing this PR?

@chamira-at
Copy link
Author

Hi 👋🏽,

Can someone with write access have a look at on this PR and approves it :).

It has been sometime and this PR is really critical for many projects.

Really appreciate your guys hard work and Thank you 🙏🏼

@mattiriihimaki
Copy link

Hello,
Will this be released at some point?

@fraune
Copy link

fraune commented Dec 8, 2022

Is there anything I can do to help get this merged in?

@RomanPodymov
Copy link

RomanPodymov commented Jun 16, 2024

Hello @mpiechocki @minixT
Can you merge this, please? The master branch is not compiling in Xcode 15.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.