mirror of
https://github.com/ivanvorobei/SwiftUI.git
synced 2026-03-25 19:01:26 +01:00
Add projects
This commit is contained in:
68
Examples/SFSymbols/.gitignore
vendored
Executable file
68
Examples/SFSymbols/.gitignore
vendored
Executable 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
7
Examples/SFSymbols/README.md
Executable file
@@ -0,0 +1,7 @@
|
||||
# SFSymbols-Playground
|
||||
A playground listing all the SFSymbols in SwiftUI
|
||||
|
||||

|
||||
|
||||
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
|
||||
60
Examples/SFSymbols/SFSymbols.playground/Contents.swift
Executable file
60
Examples/SFSymbols/SFSymbols.playground/Contents.swift
Executable 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)
|
||||
1588
Examples/SFSymbols/SFSymbols.playground/Sources/Symbols.swift
Executable file
1588
Examples/SFSymbols/SFSymbols.playground/Sources/Symbols.swift
Executable file
File diff suppressed because it is too large
Load Diff
4
Examples/SFSymbols/SFSymbols.playground/contents.xcplayground
Executable file
4
Examples/SFSymbols/SFSymbols.playground/contents.xcplayground
Executable 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
BIN
Examples/SFSymbols/demo.gif
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 2.6 MiB |
Reference in New Issue
Block a user