We have a tool in our CI which periodically updates our iOS project's Swift Package Manager dependencies. The script that does a few things, but generally speaking it
first removes the existing package.resolved at
./ProjectName.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
and then runs:
xcodebuild -resolvePackageDependencies -disablePackageRepositoryCache
This regenerated the package.resolved file to reflect the latest, updated versions of the dependencies. It is the equivalent of doing Xcode > File > Packages> Update to Latest Package Versions.
This has been working perfectly for a long time, but has stopped working since we moved from Xcode 15.4 to Xcode 16. I have also tested this with Xcode 16.1 and 16.2 - with no luck.
I have tried running this command locally, and can confirm it is not an issue with the environment of our CI. I have also tried swift package update.
Both of these commands appear to work - no errors are thrown, and the logs say "resolved source packages". However, they are not updating the packages. They are making no changes to the package.resolved file.
However, using Xcode > File > Packages> Update to Latest Package Versions in Xcode 16 works as expected - the packages are updated and the .resolved file is updated.
Is there now a different way to update Swift packages via the command line, or is this likely an Xcode 16 bug?
Update: This feels broken, so I have submitted a Feedback Report (FB16108036) but perhaps someone can suggest a workaround for the time being!
Post
Replies
Boosts
Views
Activity
Hello
I'm working on implementing some changes to my app's tab bar, particularly to support some features in the new iPad floating tab bar, which has required me to adopt some of the new tab APIs from iOS 18.
The issue I've encountered is that I would like the tabs visible in regular (floating tab bar) and compact (bottom tab bar) to be slightly different. The compact variant should show a subset of the tabs visible on iPad. For example:
Floating tab bar: Use tabs A, B, C
Bottom tab bar: Use tabs A, B
I'm finding this quite difficult, especially in the scenario of split view on iPad, where the size class and tab bar location can change as the user interacts with the app.
I went down the route of changing my tab bar controller's tabs property when the trait collection changed
tabBarController.tabs = eligibleTabs
where eligibleTabs for compact passes tabs AB, and when in regular - ABC. This throws an exception
UIViewController cannot be shared between multiple UITab
*** Assertion failure in -[UITab viewController], UITab.m:173
I'm not sharing view controllers between tabs. I can only assume that the system doesn't like me passing the same values (always at least tabs A & B) multiple times to the tabs property.
I then later noticed a new iOS 18 property on UITabBarController - compactTabIdentifiers. This seemed like exactly what I was looking for: An optional filter to display only select root-level tabs when in a compact appearance. Default is nil, which would make all tabs available.
So I changed my implementation:
tabBarController.tabs = [tabA, tabB, tabC] tabBarController.compactTabIdentifiers = [tabAIdentifier, tabBIdentifier]
and don't make any explicit updates when split view is enabled.
Unfortunately this doesn't seem to work, at least not how I would expect it to. When enabling split view on iPad, the bottom tab bar appears, but it doesn't respect the tab identifiers I passed in tabBarController.compactTabIdentifiers.
I'm not sure if this a bug or that I'm not really understanding how to use tabBarController.compactTabIdentifiers.
Does anyone have any insight on this?