Skip to content

Instantly share code, notes, and snippets.

@jboullianne
Last active July 13, 2022 09:52
Show Gist options
  • Save jboullianne/95eb7028892ce331864ed473a6e1e4de to your computer and use it in GitHub Desktop.
Save jboullianne/95eb7028892ce331864ed473a6e1e4de to your computer and use it in GitHub Desktop.
//
// ContentView.swift
// ScrollView_Tests
//
// Created by Jean-Marc Boullianne on 7/30/20.
//
import SwiftUI
struct ContentView: View {
var colors: [Color] = [.blue, .green, .red, .orange]
var body: some View {
HStack(alignment: .center, spacing: 30) {
ForEach(0..<colors.count) { i in
colors[i]
.frame(width: 250, height: 400, alignment: .center)
.cornerRadius(10)
}
}.modifier(ScrollingHStackModifier(items: colors.count, itemWidth: 250, itemSpacing: 30))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment