-
Notifications
You must be signed in to change notification settings - Fork 214
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
Fix for Xcode 13 Builds but retaining Xcode 12 and older compatibility #433
Fix for Xcode 13 Builds but retaining Xcode 12 and older compatibility #433
Conversation
…evelop Readme update
78e9334
to
3571416
Compare
In Swift 5.5 Apple changed CBCharacteristic's CBService from being unowned to weak, which breaks the existing code under Xcode 13 whilst at the same time, making said fixes break Xcode 12 due to the change being implemented via Swift versioning. I think this fix should work for both Xcode 13 users downgrading their installed Swift to 5.4 or older as well as the opposite, Xcode 12 users who upgrade their internal Swift version to 5.5 and newer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I don't like how you implemented few changes. Let's begin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot to mark required changes before :)
iOSDFULibrary/Classes/Implementation/LegacyDFU/Characteristics/DFUControlPoint.swift
Outdated
Show resolved
Hide resolved
iOSDFULibrary/Classes/Implementation/LegacyDFU/Characteristics/DFUControlPoint.swift
Outdated
Show resolved
Hide resolved
iOSDFULibrary/Classes/Implementation/LegacyDFU/Characteristics/DFUControlPoint.swift
Outdated
Show resolved
Hide resolved
iOSDFULibrary/Classes/Implementation/LegacyDFU/Characteristics/DFUPacket.swift
Outdated
Show resolved
Hide resolved
iOSDFULibrary/Classes/Implementation/LegacyDFU/Characteristics/DFUPacket.swift
Outdated
Show resolved
Hide resolved
iOSDFULibrary/Classes/Implementation/SecureDFU/Characteristics/SecureDFUPacket.swift
Outdated
Show resolved
Hide resolved
iOSDFULibrary/Classes/Implementation/SecureDFU/Characteristics/SecureDFUControlPoint.swift
Outdated
Show resolved
Hide resolved
iOSDFULibrary/Classes/Implementation/SecureDFU/Characteristics/SecureDFUControlPoint.swift
Outdated
Show resolved
Hide resolved
iOSDFULibrary/Classes/Implementation/SecureDFU/Characteristics/SecureDFUPacket.swift
Outdated
Show resolved
Hide resolved
iOSDFULibrary/Classes/Implementation/SecureDFU/Characteristics/SecureDFUPacket.swift
Outdated
Show resolved
Hide resolved
3571416
to
11173b4
Compare
(I think.)
11173b4
to
27f1583
Compare
@@ -247,7 +251,11 @@ internal struct PacketReceiptNotification { | |||
self.resetSent = false | |||
|
|||
// Get the peripheral object. | |||
#if swift(>=5.5) | |||
guard let peripheral = characteristic.service?.peripheral else { return } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it just return without logging or execution of other logic in this method? Shouldn't it invoke/clear callbacks?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True. I'll look into it today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll merge this PR and perhaps prepare another one with following changes.
In Swift 5.5 Apple changed CBCharacteristic's CBService from being unowned to weak, which breaks the existing code under Xcode 13 whilst at the same time, making said fixes break Xcode 12 due to the change being implemented via Swift versioning. I think this fix should work for both Xcode 13 users downgrading their installed Swift to 5.4 or older as well as the opposite, Xcode 12 users who upgrade their internal Swift version to 5.5 and newer.