Skip to content

Instantly share code, notes, and snippets.

View VolkovsaVSA's full-sized avatar

Sergei Volkov VolkovsaVSA

View GitHub Profile
@VolkovsaVSA
VolkovsaVSA / ScrollableView.swift
Created May 3, 2023 08:20 — forked from jfuellert/ScrollableView.swift
A scrollable SwiftUI view, UIScrollView wrapper. ScrollableView lets you read and write content offsets for scrollview in SwiftUI, with and without animations.
import SwiftUI
struct ScrollableView<Content: View>: UIViewControllerRepresentable, Equatable {
// MARK: - Coordinator
final class Coordinator: NSObject, UIScrollViewDelegate {
// MARK: - Properties
private let scrollView: UIScrollView
var offset: Binding<CGPoint>