Skip to content

Commit

Permalink
fix: compieler error on scroll view offset extension
Browse files Browse the repository at this point in the history
  • Loading branch information
gtokman committed May 3, 2021
1 parent 6300104 commit 1fb4ed0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/ExtensionKit/SwiftUI/View.swift
Expand Up @@ -437,14 +437,14 @@ public extension View {
/// - Parameter offsetX: Binding for offset
/// - Returns: View
func scrollOffsetX(_ offsetX: Binding<CGFloat>?) -> some View {
ScrollViewOffSetReaderRepresentable(offset: offsetX, isOffsetX: true) { self }
ScrollViewOffSetReaderRepresentable(offset: offsetX ?? .constant(0), isOffsetX: true) { self }
}

/// Get the scroll view content offset Y
/// - Parameter offsetY: Binding for offset
/// - Returns: View
func scrollOffsetY(_ offsetY: Binding<CGFloat>?) -> some View {
ScrollViewOffSetReaderRepresentable(offset: offsetY, isOffsetX: false) { self }
ScrollViewOffSetReaderRepresentable(offset: offsetY ?? .constant(0), isOffsetX: false) { self }
}

}

0 comments on commit 1fb4ed0

Please sign in to comment.