Last active
July 13, 2022 09:52
-
-
Save jboullianne/95eb7028892ce331864ed473a6e1e4de to your computer and use it in GitHub Desktop.
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
// | |
// 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