-
Notifications
You must be signed in to change notification settings - Fork 196
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
Xcode 13 compatibility #411
Conversation
Sources/Platform.swift
Outdated
let BONFontFeatureTypeIdentifierKey = UIFontDescriptor.FeatureKey.featureIdentifier | ||
let BONFontFeatureSelectorIdentifierKey = UIFontDescriptor.FeatureKey.typeIdentifier | ||
let BONFontFeatureTypeIdentifierKey = UIFontDescriptor.FeatureKey.type | ||
let BONFontFeatureSelectorIdentifierKey = UIFontDescriptor.FeatureKey.selector |
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.
These have been deprecated since iOS 8, but we somehow didn't get compile-time warnings, but in this release they must have finally removed them because we get run-time crashes due to failed dynamic symbol loading or something like that. Migrated them to the iOS 9+ variants.
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.
There is a radar for this in the release notes: https://developer.apple.com/documentation/xcode-release-notes/xcode-13-beta-release-notes
Apps that contain Swift code referencing featureIdentifier or typeIdentifier fail to launch on earlier OS releases. (79090498)
Seems like they might be fixing it at some point.
Sources/UIKit/AdaptiveStyle.swift
Outdated
case body | ||
case preferred | ||
|
||
@available(iOS 11, tvOS 11, *) |
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 checked, and apparently the stuff we use for this actually goes back to iOS 10, but I don't see any point in back-porting it now.
case control | ||
public static var control: AdaptiveStyle { | ||
AdaptiveStyle(behavior: .control) | ||
} |
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.
Converted all these enum cases to static functions to maintain call site compatibility.
Current coverage for BonMot.framework is
|
Files changed | - | - |
---|---|---|
AdaptableTextContainer.swift | 42.00% |
🚫 |
AdaptiveStyle.swift | 73.99% |
|
StyleableUIElement.swift | 74.62% |
Powered by xcov
Generated by 🚫 Danger
Hmmm, it looks like there's some weirdness with let BONFontFeatureTypeIdentifierKey: UIFontDescriptor.FeatureKey = {
if #available(iOS 10, macCatalyst 13, tvOS 10, watchOS 2, *) {
return .type
}
else {
return .featureIdentifier
}
}()
let BONFontFeatureSelectorIdentifierKey: UIFontDescriptor.FeatureKey = {
if #available(iOS 10, macCatalyst 13, tvOS 10, watchOS 2, *) {
return .selector
}
else {
return .typeIdentifier
}
}() That builds in Xcode 13, but in Xcode 12 I get:
|
Thanks @ZevEisenberg! Any further thoughts on why the availability check is not working as expected? |
Nope. Not sure if bug or what. You might want to try reproing in a sample project, and then doing a WWDC lab or at least radar if you can't figure it out. |
From my reading, it appears that the
|
The easiest and most minimal solution might be to bump the minimum iOS version to 11.0 and remove the availability check, which I think I might prefer at this point. |
I'm fine with that. Maybe do an audit for any other availability checks that can be removed. It'll need to be a major version bump because of semver |
Any update on this? :) |
Hi, is there any branch for BonMot that I can test my project on Xcode 13/iOS15 ? |
Sorry folks, looks like we are blocked on known bug in Xcode 13b2, unless y'all can come up with a workaround: #411 (comment) |
Fixes #409, but does not add Xcode 13 to the CI test runners because CircleCI doesn't support Xcode 13 yet.