Merge pull request #3 from AndrewSB/patch-1

Update not found print to include missing ID
This commit is contained in:
Amzd 2020-07-23 21:50:34 +02:00 committed by GitHub
commit 64e8e808b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -68,7 +68,7 @@ public struct ScrollViewProxy<ID: Hashable> {
public func scrollTo(_ id: ID, alignment: Alignment = .top, animated: Bool = true) {
guard let scrollView = coordinator.scrollView else { return }
guard let cellFrame = coordinator.frames[id] else {
return print("ID not found, make sure to add views with `.id(_:scrollView:)`")
return print("ID (\(id)) not found, make sure to add views with `.id(_:scrollView:)`")
}
let visibleFrame = frame(cellFrame, with: alignment)