Lowered minimum deployment versions for iOS and Mac Catalyst to allow launch on iOS versions 15 and 16#782
Conversation
… on iOS 15 and 16 Lowered minimum deployment versions for iOS and Mac Catalyst to allow launch on iOS versions 15 and 16.
adam-fowler
left a comment
There was a problem hiding this comment.
If we're going to do this, let's do it properly. I've added a suggestion for platform in the Package.swift. You would then have to tag everything
@available(macOS 15, iOS 18, macCatalyst 18, tvOS 18, visionOS 2, *)Also can you make sure you've compiled the PerformanceTest target and all the tests
Package.swift
Outdated
| let package = Package( | ||
| name: "hummingbird", | ||
| platforms: [.macOS(.v14), .iOS(.v17), .macCatalyst(.v17), .tvOS(.v17), .visionOS(.v1)], | ||
| platforms: [.macOS(.v14), .iOS(.v15), .macCatalyst(.v15), .tvOS(.v17), .visionOS(.v1)], |
There was a problem hiding this comment.
| platforms: [.macOS(.v14), .iOS(.v15), .macCatalyst(.v15), .tvOS(.v17), .visionOS(.v1)], | |
| platforms: [.macOS(.v10_15), .iOS(.v13), .macCatalyst(.v13), .tvOS(.v13), .visionOS(.v1)], |
|
Thanks for the PR! I concur with @adam-fowler too |
…l on iOS 15 and 16 Included macOS (native), tvOS, and visionOS into the lower version party.
|
@adam-fowler @Joannis Some notes on the new commit:
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #782 +/- ##
==========================================
+ Coverage 82.94% 83.00% +0.06%
==========================================
Files 124 124
Lines 6185 6185
==========================================
+ Hits 5130 5134 +4
+ Misses 1055 1051 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| let package = Package( | ||
| name: "hummingbird", | ||
| platforms: [.macOS(.v14), .iOS(.v17), .macCatalyst(.v17), .tvOS(.v17), .visionOS(.v1)], | ||
| platforms: [.macOS(.v11), .iOS(.v15), .macCatalyst(.v15), .tvOS(.v15), .visionOS(.v1)], |
There was a problem hiding this comment.
The equivalent versions of macOS and iOS are three versions apart eg 11 and 14, 12 and 15. Which pair of versions should it be?
There was a problem hiding this comment.
I've used the earliest versions of each platform that Xcode allowed me to select for minimum deployment version in the project settings. If you want I could raise macOS to 12.
There was a problem hiding this comment.
Xcode doesn't have that option in its drop down. All devices that run iOS 14 also run iOS 15, so there shouldn't be a reason for someone to run iOS 14.
There was a problem hiding this comment.
It doesn't mean those users have iOS 15 installed. You are editing Package.swift with a text editor yeah? You can type whatever you want. I'd prefer to stick to the three versions apart and upping the requirement for macOS doesn't seem very sensible.
There was a problem hiding this comment.
Package.swift may be editable in a text editor, but someone integrating Hummingbird into an iOS app will very likely be doing that in Xcode, and there's no option in Xcode for them to select a version iOS 14 as minimum.
I'm assuming the lowest version selectable in Xcode would be the minimum that Apple are willing to support, so is this 3-version difference relevant in that case?
… on iOS 15 and 16 Code review changes – applied version restrictions to ApplicationProtocol and Application types.
adam-fowler
left a comment
There was a problem hiding this comment.
PerformanceTest target requires macOS 14 etc
Also HummingbirdTesting needs @available(macOS 14, iOS 17, tvOS 17, *) wherever ApplicationProtocol is referenced
And finally you need to run swift format on the code
swift format format -ir Sources
After that we should be good
|
|
||
| struct Object: ResponseEncodable { | ||
| let message: String | ||
| if #available(macOS 13, iOS 16, tvOS 16, *) { |
There was a problem hiding this comment.
| if #available(macOS 13, iOS 16, tvOS 16, *) { | |
| if #available(macOS 14, iOS 17, tvOS 17, *) { |
|
|
||
| // run app | ||
| try await app.runService() | ||
| } |
There was a problem hiding this comment.
| } | |
| } else { | |
| fatalError("Hummingbird requires macOS 14, iOS 17 or tvOS 17") | |
| } |
| } | ||
|
|
||
| /// Extends `ApplicationProtocol` to support testing of applications | ||
| @available(macOS 13, iOS 16, tvOS 16, *) |
There was a problem hiding this comment.
| @available(macOS 13, iOS 16, tvOS 16, *) | |
| @available(macOS 14, iOS 17, tvOS 17, *) |
Fix for issue 781: #781.
The main changes are lowering the minimum deployment version in the Package.swift files to
.v15for iOS and Mac Catalyst, which are the only two platforms I'm able to test this change on.These changes then required
@availableor#availableattributes to be added to specific classes, extensions and methods (as dictated by the compiler). In many places, iOS 16 could be used rather than iOS 17, so I used the lower version in these places.Before this change I was experiencing a crash as detailed in the issue linked above. After this change, my app builds and runs successfully on Apple's iOS 16 simulator, and on an iPhone 6s I have running iOS 15.8.5.