|
6 | 6 | [](https://cocoapods.org/pods/SDWebImageSwiftUI)
|
7 | 7 | [](https://github.com/Carthage/Carthage)
|
8 | 8 | [](https://swift.org/package-manager/)
|
| 9 | +[](https://codecov.io/gh/SDWebImage/SDWebImageSwiftUI) |
9 | 10 |
|
10 | 11 | ## What's for
|
11 | 12 |
|
@@ -344,6 +345,23 @@ Demo Tips:
|
344 | 345 | 4. Pinch gesture (Digital Crown on watchOS, play button on tvOS) to zoom-in detail page image.
|
345 | 346 | 5. Clear cache and go to detail page to see progressive loading.
|
346 | 347 |
|
| 348 | +## Test |
| 349 | + |
| 350 | +SDWebImageSwiftUI has Unit Test to increase code quality. For SwiftUI, there are no official Unit Test solution provided by Apple. |
| 351 | + |
| 352 | +However, since SwiftUI is State-Based and Attributed-Implemented layout system, there are open source projects who provide the solution: |
| 353 | + |
| 354 | ++ [ViewInspector](https://github.com/nalexn/ViewInspector): Inspect View's runtime attribute value (like `.frame` modifier, `.image` value). We use this to test `AnimatedImage` and `WebImage` |
| 355 | ++ [SwiftUI-Introspect](https://github.com/siteline/SwiftUI-Introspect): Introspect the native UIKit/AppKit View, even for SwiftUI component (like `List`, which is actually `UITableView` in implementation). We use this to test `AnimatedImage` |
| 356 | + |
| 357 | +To run the test: |
| 358 | + |
| 359 | +1. Run `carthage build` on root directory to install the dependency. |
| 360 | +2. Open `SDWebImageSwiftUI.xcodeproj`, wait for SwiftPM finishing downloading the test dependency. |
| 361 | +3. Choose `SDWebImageSwiftUITests` scheme and start testing. |
| 362 | + |
| 363 | +We've already setup the CI pipeline, each PR will run the test case and upload the test report to [codecov](https://codecov.io/gh/SDWebImage/SDWebImageSwiftUI). |
| 364 | + |
347 | 365 | ## Screenshot
|
348 | 366 |
|
349 | 367 | + iOS Demo
|
@@ -376,6 +394,15 @@ Which means, this project is one core use case and downstream dependency, which
|
376 | 394 |
|
377 | 395 | [DreamPiggy](https://github.com/dreampiggy)
|
378 | 396 |
|
| 397 | +## Thanks |
| 398 | + |
| 399 | +- [SDWebImage](https://github.com/SDWebImage/SDWebImage) |
| 400 | +- [libwebp](https://github.com/SDWebImage/libwebp-Xcode) |
| 401 | +- [Kingfisher](https://github.com/onevcat/Kingfisher) |
| 402 | +- [SwiftUIX](https://github.com/SwiftUIX/SwiftUIX) |
| 403 | +- [SwiftUI-Introspect](https://github.com/siteline/SwiftUI-Introspect) |
| 404 | +- [ViewInspector](https://github.com/nalexn/ViewInspector) |
| 405 | + |
379 | 406 | ## License
|
380 | 407 |
|
381 | 408 | SDWebImageSwiftUI is available under the MIT license. See the LICENSE file for more info.
|
|
0 commit comments