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

Compilation under Xcode 13 #48

Closed
PFRene opened this issue Sep 16, 2021 · 8 comments
Closed

Compilation under Xcode 13 #48

PFRene opened this issue Sep 16, 2021 · 8 comments

Comments

@PFRene
Copy link

PFRene commented Sep 16, 2021

I'm getting loads of warnings when trying to compile this in the latest Xcode 13 RC (with Swift5) - mostly all errors are related to this sort of thing : "Argument type 'CBService?' does not conform to expected type 'CBUUIDConvertible'"

Any thoughts or suggestions? I'm having trouble working it out

EDIT: maybe helpful : If I open the same project into my saved copy of 12.5.1, it compiles the first try

@jordanebelanger
Copy link
Owner

Hello, I did a somewhat dirty fix (explicit unwrappings...) but I think it shouldn't cause any issue.

If you want, try with this branch https://github.com/jordanebelanger/SwiftyBluetooth/tree/swift5.5 until I finish merging the changes, need to make them backward compatible with Swift older than 5.5, that will take some time.

@PFRene
Copy link
Author

PFRene commented Sep 28, 2021

Thanks! The 5.5 branch will help in the mean time, at least it compiles again ;)

@Rolvar
Copy link

Rolvar commented Oct 29, 2021

@jordanebelanger are you planning to do a proper fix and release a new version to support XCode 13 builds? thanks in advance

@jordanebelanger
Copy link
Owner

@Rolvar
I have a feeling that the current fix with the explicit unwrapping might be fine anyway and that it was just some sort of weird swift/objective-c evolution thing that led to the corebluetooth properties in question becoming optional.

Perhaps you or @PFRene can comment if you've been using the swift5.5 branch as to whether you've had any crashes using the new branch related to the new explicit unwrappings?

@Rolvar
Copy link

Rolvar commented Oct 29, 2021

@jordanebelanger thanks for the quick reply, I've forked your code and you're right, seems to be something about how obj-c properties are being translated to optionals in swift, should be a better way, maybe use guard let instead? and make those throws an error that we can handle in production?

@jordanebelanger
Copy link
Owner

I don't wont to put unnecessary guard lets anywhere quite frankly I'd rather the program just crash if this is really some weird objective-c quirk.

Alright, I'll push a new cocoapods major release for this.

@jordanebelanger
Copy link
Owner

V3.0.0 is up and should fix xcode 13 related issues

@Rolvar
Copy link

Rolvar commented Oct 29, 2021

Thanks @jordanebelanger 👏 🍻

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

No branches or pull requests

3 participants