-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from swiftui-library/feat/metadata-callback
add callback for view layout
- Loading branch information
Showing
5 changed files
with
75 additions
and
50 deletions.
There are no files selected for viewing
28 changes: 21 additions & 7 deletions
28
SnapToScrollDemo/Sources/Example 2/Example2ContentView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import Foundation | ||
import SwiftUI | ||
|
||
public enum SnapToScrollEvent { | ||
|
||
/// Swiped to index. | ||
case swipe(index: Int) | ||
|
||
/// HStackSnap completed layout calculations. (item index, item leading offset) | ||
case didLayout(layoutInfo: [Int: CGFloat]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters