-
Notifications
You must be signed in to change notification settings - Fork 3
/
ContentView.swift
35 lines (31 loc) · 1015 Bytes
/
ContentView.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//
// ContentView.swift
// P18J LayoutAndGeometry
//
// Created by Julian Moorhouse on 13/05/2021.
//
import SwiftUI
struct ContentView: View {
let colours: [Color] = [.red, .green, .blue, .orange, .pink, .purple, .yellow]
var body: some View {
GeometryReader { fullView in
ScrollView(.vertical) {
ForEach(0..<50) { index in
GeometryReader { geo in
Text("Row #\(index)")
.font(.title)
.frame(width: fullView.size.width)
.background(self.colours[index % 7])
.rotation3DEffect(.degrees(Double(geo.frame(in: .global).minY - fullView.size.height / 2) / 5), axis: (x: 0, y: 1, z: 0))
}
.frame(height: 40)
}
}
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}