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

68
Examples/SFSymbols/.gitignore vendored Executable file
View File

@@ -0,0 +1,68 @@
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## Build generated
build/
DerivedData/
## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/
## Other
*.moved-aside
*.xccheckout
*.xcscmblueprint
## Obj-C/Swift specific
*.hmap
*.ipa
*.dSYM.zip
*.dSYM
## Playgrounds
timeline.xctimeline
playground.xcworkspace
# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
# Package.resolved
.build/
# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# Pods/
# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts
Carthage/Build
# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output

7
Examples/SFSymbols/README.md Executable file
View File

@@ -0,0 +1,7 @@
# SFSymbols-Playground
A playground listing all the SFSymbols in SwiftUI
![Demo GIF](https://github.com/jstart/SFSymbols-Playground/blob/master/demo.gif)
You can download the SF Symbols.app beta for Mac here: https://developer.apple.com/design/downloads/SF-Symbols.dmg
A Swift Package has already been developed to make SF Symbols an enum instead of strings: https://twitter.com/simjp/status/1135936933916336128

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>

BIN
Examples/SFSymbols/demo.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB