Skip to content

Instantly share code, notes, and snippets.

@AvdLee
Created February 9, 2022 07:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AvdLee/e675d5c7fd6a014a806b170766f190a6 to your computer and use it in GitHub Desktop.
Save AvdLee/e675d5c7fd6a014a806b170766f190a6 to your computer and use it in GitHub Desktop.
Horizontal Scroll in StockAdvisor
ScrollView(.horizontal, showsIndicators: false) {
HStack(spacing: 0) {
ForEach(viewModel.criteria(for: category), id: \.valueProvider.title) { criteria in
StockCriteriaView(criteria: criteria)
.frame(width: UIScreen.main.bounds.width - 60)
.padding(.trailing, 12)
}
}
}.frame(width: UIScreen.main.bounds.width - 48)
.padding(.horizontal, 14)
.introspectScrollView { scrollView in
scrollView.isPagingEnabled = true
scrollView.clipsToBounds = false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment