Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Sources/BSWInterfaceKit/SwiftUI/Actors/PagingHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ private class PagingHandlerPreviewViewModel {
Use `loadMoreContent()` to fetch the next page,
and `getState()`/`getItems()` to read the results from outside the actor.
*/

// SKIP @nobridge
public actor PagingHandler<Item: Sendable> {

Expand Down Expand Up @@ -153,9 +154,11 @@ public actor PagingHandler<Item: Sendable> {
}
}

/// - Returns: A pre-filled mock instance of `PagingHandler`. (Not for production)
public static func mock() -> PagingHandler {
let handler = PagingHandler(initialPage: 0, fetchPage: { _ in .empty })
let handler = PagingHandler(
initialPage: 0,
fetchPage: { _ in .empty }
)
Task { await handler.setNoMorePages() }
return handler
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ open class InfiniteScrollingDataSource<ListItem: Identifiable & Sendable> {
try await loadMoreContent()
}

#if os(iOS)
#if os(iOS)
/// Use at your own peril
public var unsafeItemsBinding: Binding<[ListItem]> {
.init(get: {
Expand All @@ -81,7 +81,7 @@ open class InfiniteScrollingDataSource<ListItem: Identifiable & Sendable> {
self.items = newItems
})
}
#endif
#endif

/// MARK: Private

Expand Down Expand Up @@ -114,12 +114,12 @@ open class InfiniteScrollingDataSource<ListItem: Identifiable & Sendable> {
}

private func performAnimatedMutation(_ mutation: () -> Void) {
#if os(Android)
#if os(Android)
mutation()
#else
#else
withAnimation {
mutation()
}
#endif
#endif
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
//
// Created by Michele Restuccia on 25/2/26.
//

import SwiftUI

#if os(Android)
import SkipFuseUI
Expand All @@ -19,6 +24,20 @@ public extension SwiftUI.View {

#endif

public extension View {

/// Expands the hit-testing area of a `Button` to the full view on iOS.
/// Not required on Android, where the default behavior already covers the whole view.
@ViewBuilder
func contentRectangleShape() -> some View {
#if canImport(Darwin)
self.contentShape(Rectangle())
#else
self
#endif
}
}

public extension View {
func errorAlert(error: Binding<Error?>) -> some View {
modifier(ErrorAwareView(errorBinding: error))
Expand Down
19 changes: 0 additions & 19 deletions Sources/BSWInterfaceKit/SwiftUI/Extensions/View+ViewBuilders.swift

This file was deleted.

Loading