Skip to content

Commit 993a1dd

Browse files
committed
Fixed stack.
1 parent 810994f commit 993a1dd

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

Sources/SwiftUIExtension/Extensions/View+Layout.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import SwiftUI
22

3-
#warning("todo to del")
3+
#warning("todo: to del")
44
/*extension View {
55

66
public func horizontalSystemPadding(to view: HorizontalSystemPadding.PaddingView) -> some View {

Sources/SwiftUIExtension/Views/SelectableStack.swift

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,18 @@ public struct SelectableStack<Data, Content>: View where Data : RandomAccessColl
3939
}
4040
#endif
4141
case .horizontal:
42-
EmptyView()
42+
HStack(spacing: space) {
43+
if let data {
44+
ForEach(data) { element in
45+
content(element, selectedElement == element)
46+
}
47+
}
48+
}
49+
#if os(iOS)
50+
.onChange(of: selectedElement) { _ in
51+
UIFeedbackGenerator.impactOccurred(.light)
52+
}
53+
#endif
4354
}
4455
}
4556

0 commit comments

Comments
 (0)