Skip to content

Commit

Permalink
Add render lock lib
Browse files Browse the repository at this point in the history
  • Loading branch information
gh123man committed Oct 17, 2023
1 parent 5128840 commit 78fd130
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@
"revision" : "3ced72fccb284235c266c1e8a32f1bf93129fc74",
"version" : "1.1.0"
}
},
{
"identity" : "swiftui-renderlock",
"kind" : "remoteSourceControl",
"location" : "https://github.com/gh123man/SwiftUI-RenderLock",
"state" : {
"revision" : "122050e7a84febbb3e7959f9fcfa25783c6abbfb",
"version" : "1.0.1"
}
}
],
"version" : 2
Expand Down
6 changes: 5 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ let package = Package(
dependencies: [
// Dependencies declare other packages that this package depends on.
.package(url: "https://github.com/siteline/SwiftUI-Introspect.git", from: "1.0.0"),
.package(url: "https://github.com/gh123man/SwiftUI-RenderLock", from: "1.0.1"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
Expand All @@ -27,7 +28,10 @@ let package = Package(
dependencies: [
.product(
name: "SwiftUIIntrospect",
package: "SwiftUI-Introspect")
package: "SwiftUI-Introspect"),
.product(
name: "RenderLock",
package: "SwiftUI-RenderLock")
]
),
]
Expand Down
8 changes: 4 additions & 4 deletions Sources/Refresher/Refresher.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Foundation
import SwiftUI
import SwiftUIIntrospect
import RenderLock

public typealias RefreshAction = (_ completion: @escaping () -> ()) -> ()
public typealias AsyncRefreshAction = () async -> ()
Expand Down Expand Up @@ -210,10 +211,9 @@ public struct RefreshableScrollView<Content: View, RefreshView: View>: View {

// Content wrapper with refresh banner
VStack(spacing: 0) {
LockedRenderView(lock: $renderLock) {
content
}
.offset(y: refreshHeaderOffset)
content
.renderLocked(with: $renderLock)
.offset(y: refreshHeaderOffset)
}
// renders over content
refreshSpinner
Expand Down
34 changes: 0 additions & 34 deletions Sources/Refresher/RenderControl.swift

This file was deleted.

0 comments on commit 78fd130

Please sign in to comment.