Hello Swift Community!
The review of ST-0017 “Consolidate Swift Testing's image attachments API across platforms” begins now and runs through Thursday October 30, 2025. The proposal is available here:
Reviews are an important part of the Swift evolution process. All review feedback should be either on this forum thread or, if you would like to keep your feedback private, directly to the review manager. When messaging the review manager directly, please keep the proposal link at the top of the message.
Note: This is a shorter review period because this proposal is consolidating & fixing up the differences between ST-0014 and ST-0015 before the next release of Swift goes out and turns this proposal into an ABI and API breaking change.
Trying it out
To try this feature out, add a dependency to the jgrynspan/image-attachment-adjustments branch of swift-testing to your project:
...
dependencies: [
...
.package(
url: "https://github.com/swiftlang/swift-testing.git",
branch: "jgrynspan/image-attachment-adjustments"
),
]
Then, add a target dependency to your test target:
.testTarget(
...
dependencies: [
...
.product(name: "Testing", package: "swift-testing"),
.product(name: "_Testing_ExperimentalImageAttachments", package: "swift-testing"),
]
)
Finally, import Swift Testing & the appropriate overlay(s) to any source file that will attach an image to a test:
import X
import _Testing_X
Where X is the module name of the image type you're using:
| Image Type | Module Name |
|---|---|
CGImage |
CoreGraphics |
CIImage |
CoreImage |
NSImage |
AppKit |
UIImage |
UIKit |
On Windows, X needs to be WinSDK (as in: import _Testing_WinSDK).
Note: This extra product dependency and extra
importstatement are a side effect of how packages are built. They will not be required in the final implementation of this feature.
What goes into a review?
The goal of the review process is to improve the proposal under review
through constructive criticism and, eventually, determine the direction of
Swift. When writing your review, here are some questions you might want to
answer in your review:
-
What is your evaluation of the proposal?
-
Is the problem being addressed significant enough to warrant a change to Swift?
-
Does this proposal fit well with the feel and direction of Swift?
-
If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?
-
How much effort did you put into your review? A glance, a quick reading, or an in-depth study?
More information about the Swift evolution process is available at
swift-evolution/process.md at main · swiftlang/swift-evolution · GitHub
Thank you for contributing to Swift!
Rachel Brindle
Review Manager