Add projects

This commit is contained in:
Ivan Vorobei
2019-06-07 09:04:22 +03:00
parent bbb48dbce9
commit fffd52a399
16 changed files with 1923 additions and 1 deletions

View File

@@ -0,0 +1,60 @@
import UIKit
import PlaygroundSupport
import SwiftUI
var colors: [Color] = [.red, .blue, .black, .gray, .green, .yellow, .orange, .pink, .purple]
struct SymbolRow: View {
var symbol: String
var body: some View {
HStack {
Image(systemName: symbol).foregroundColor(colors.randomElement())
Divider()
Text(symbol)
}
}
}
struct SymbolDetail: View {
var symbol: String
var body: some View {
VStack {
Image(systemName: symbol)
.foregroundColor(colors.randomElement())
.imageScale(.large)
.scaleEffect(3.0)
.padding(.bottom, 100)
Divider()
// .animation(Animation.basic().delay(0.25))
Text(symbol).font(.headline)
}
}
}
struct ContentView: View {
var body: some View {
let list = (0..<symbols.count)
return NavigationView {
List(list) { index in
NavigationButton(destination: SymbolDetail(symbol: symbols[index])) {
SymbolRow(symbol: symbols[index])
}
}
}.navigationBarTitle(Text("SF Symbols"))
}
}
#if DEBUG
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
#endif
let contentView = ContentView()
PlaygroundPage.current.liveView = UIHostingController(rootView: contentView)

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<playground version='5.0' target-platform='ios'>
<timeline fileName='timeline.xctimeline'/>
</playground>