diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml index 2e120e03..8ab57f7f 100644 --- a/.github/workflows/swift.yml +++ b/.github/workflows/swift.yml @@ -11,7 +11,7 @@ jobs: with: lfs: true - name: Test BSWInterfaceKit iOS - run: set -o pipefail && xcodebuild -scheme BSWInterfaceKit -destination "platform=iOS Simulator,name=iPhone 16,OS=26.0" test | xcbeautify --renderer github-actions + run: set -o pipefail && xcodebuild -scheme BSWInterfaceKit -destination "platform=iOS Simulator,name=iPhone 17,OS=26.0" test | xcbeautify --renderer github-actions macos-build: runs-on: mobile diff --git a/Sources/BSWInterfaceKit/SwiftUI/Views/AsyncButton.swift b/Sources/BSWInterfaceKit/SwiftUI/Views/AsyncButton.swift index 72cc34b5..752b59c1 100644 --- a/Sources/BSWInterfaceKit/SwiftUI/Views/AsyncButton.swift +++ b/Sources/BSWInterfaceKit/SwiftUI/Views/AsyncButton.swift @@ -123,17 +123,25 @@ public struct AsyncButton: View { } }() - if let hudSuccessConfiguration, let hudConfiguration { - self.hudState = hudSuccessConfiguration - try? await Task.sleep(for: .seconds(hudConfiguration.successMessageInterval) ) - } - self.hudState = .none - switch result { case .success: - break + if let hudSuccessConfiguration, let hudConfiguration { + self.hudState = hudSuccessConfiguration + try? await Task.sleep(for: .seconds(hudConfiguration.successMessageInterval) ) + } + self.hudState = .none case .failure(let failure): - self.error = failure + #if canImport(Darwin) + withAnimation { + self.hudState = .none + } completion: { + error = failure + } + #else + self.hudState = .none + try? await Task.sleep(for: .milliseconds(300)) + error = failure + #endif } withAnimation { diff --git a/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/ClassicProfileViewControllerTests/sampleLayout.402x874.png b/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/ClassicProfileViewControllerTests/sampleLayout.402x874.png new file mode 100644 index 00000000..7bb5e51d Binary files /dev/null and b/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/ClassicProfileViewControllerTests/sampleLayout.402x874.png differ diff --git a/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/ContentViewTests/layout.402x874.png b/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/ContentViewTests/layout.402x874.png new file mode 100644 index 00000000..0eef3f3a Binary files /dev/null and b/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/ContentViewTests/layout.402x874.png differ diff --git a/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/HorizontalPagedCollectionViewLayoutTests/availableWidthLayout.402x874.png b/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/HorizontalPagedCollectionViewLayoutTests/availableWidthLayout.402x874.png new file mode 100644 index 00000000..5468b3a8 Binary files /dev/null and b/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/HorizontalPagedCollectionViewLayoutTests/availableWidthLayout.402x874.png differ diff --git a/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/HorizontalPagedCollectionViewLayoutTests/centeredLayout.402x874.png b/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/HorizontalPagedCollectionViewLayoutTests/centeredLayout.402x874.png new file mode 100644 index 00000000..aa821105 Binary files /dev/null and b/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/HorizontalPagedCollectionViewLayoutTests/centeredLayout.402x874.png differ diff --git a/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/HorizontalPagedCollectionViewLayoutTests/layout.402x874.png b/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/HorizontalPagedCollectionViewLayoutTests/layout.402x874.png new file mode 100644 index 00000000..f986a36b Binary files /dev/null and b/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/HorizontalPagedCollectionViewLayoutTests/layout.402x874.png differ diff --git a/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/SelectableTableViewDataSourceTests/layout.402x874.png b/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/SelectableTableViewDataSourceTests/layout.402x874.png new file mode 100644 index 00000000..91fd70a5 Binary files /dev/null and b/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/SelectableTableViewDataSourceTests/layout.402x874.png differ diff --git a/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/ShadowTests/layout.402x874.png b/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/ShadowTests/layout.402x874.png new file mode 100644 index 00000000..92b07569 Binary files /dev/null and b/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/ShadowTests/layout.402x874.png differ diff --git a/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/UIViewControllerTaskTests/taskErrorView.402x874.png b/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/UIViewControllerTaskTests/taskErrorView.402x874.png new file mode 100644 index 00000000..8b93ca6d Binary files /dev/null and b/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/UIViewControllerTaskTests/taskErrorView.402x874.png differ diff --git a/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/UIViewControllerTaskTests/taskLoadingView.402x874.png b/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/UIViewControllerTaskTests/taskLoadingView.402x874.png new file mode 100644 index 00000000..75473561 Binary files /dev/null and b/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/UIViewControllerTaskTests/taskLoadingView.402x874.png differ diff --git a/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/UIViewControllerTaskTests/taskSuccessView.402x874.png b/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/UIViewControllerTaskTests/taskSuccessView.402x874.png new file mode 100644 index 00000000..37c892d5 Binary files /dev/null and b/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/UIViewControllerTaskTests/taskSuccessView.402x874.png differ diff --git a/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/UIViewControllerTests/addBottomActionButton.402x874.png b/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/UIViewControllerTests/addBottomActionButton.402x874.png new file mode 100644 index 00000000..f174a2ad Binary files /dev/null and b/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/UIViewControllerTests/addBottomActionButton.402x874.png differ diff --git a/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/UIViewControllerTests/addBottomActionButtonWithMargin.402x874.png b/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/UIViewControllerTests/addBottomActionButtonWithMargin.402x874.png new file mode 100644 index 00000000..8385933a Binary files /dev/null and b/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/UIViewControllerTests/addBottomActionButtonWithMargin.402x874.png differ diff --git a/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/UIViewControllerTests/addBottomController.402x874.png b/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/UIViewControllerTests/addBottomController.402x874.png new file mode 100644 index 00000000..ffac491b Binary files /dev/null and b/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/UIViewControllerTests/addBottomController.402x874.png differ diff --git a/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/UIViewControllerTests/errorView.402x874.png b/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/UIViewControllerTests/errorView.402x874.png new file mode 100644 index 00000000..1cc1357c Binary files /dev/null and b/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/UIViewControllerTests/errorView.402x874.png differ diff --git a/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/UIViewControllerTests/loadingView.402x874.png b/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/UIViewControllerTests/loadingView.402x874.png new file mode 100644 index 00000000..9f1566b9 Binary files /dev/null and b/Tests/BSWInterfaceKitTests/Suite/__Snapshots__/UIViewControllerTests/loadingView.402x874.png differ