โจTestSVGFE
Last updated
Last updated
โฌ๏ธ ้่ฆ๏ผ
// 2022.02.15 (*)
import SwiftUI
// โญ๏ธ GridItem + ๐
ฟ๏ธ Repeatable
extension GridItem: Repeatable {}
/// test ScrollVGridForEach
struct TestSVGFE: View {
var body: some View {
// โญ๏ธ GridItem + ๐
ฟ๏ธ Repeatable
let twoFlexCols = GridItem(.flexible()) * 6
// ๐ ScrollVGridForEach
ScrollVGridForEach(0..<80, columns: twoFlexCols) { i in
let codepoint = i + 0x1f600 // code point
let codepointString = String(format: "%02X", codepoint) // hex format
let emoji = String(Character(UnicodeScalar(codepoint)!)) // emoji
VStack(spacing: 12) {
Text("\(emoji)")
Text("\(codepointString)")
.font(.system(.caption, design: .monospaced))
.foregroundColor(.secondary)
}
.shadow(radius: 2)
.padding()
// ๐ShapeStyle +LinearGradient, +.white()
.background(.vertical(.white(0.28), .white(0.2)))
.cornerRadius(4)
.compositingGroup()
.shadow(radius: 4)
}
}
}
struct TestSVGFE_Previews: PreviewProvider {
static var previews: some View {
TestSVGFE().padding()
}
}
example of ScrollVGridForEach.