This file contains hidden or 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
| import SwiftUI | |
| // https://x.com/jrsaruo_tech/status/1893585977760743750 | |
| @available(iOS 18, *) | |
| struct HorizontalInlinePicker<SelectionValue, Content>: View where SelectionValue: Hashable, Content: View { | |
| @Binding var selection: SelectionValue | |
| @State private var centerValue: SelectionValue? |
This file contains hidden or 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
| import SwiftUI | |
| struct HPicker<SelectionValue, Content>: View where SelectionValue: Hashable, Content: View { | |
| private var items: [SelectionValue] | |
| private var numberOfDisplays: Int | |
| private var content: (SelectionValue) -> Content | |
| @Binding private var selection: SelectionValue? | |
| @State private var contentOffset: Double = 0 | |
| @State private var itemWidth: Double = 100.0 |
OlderNewer