Skip to content

Commit

Permalink
Bundle SF Symbols icons as SVGs
Browse files Browse the repository at this point in the history
  • Loading branch information
hmarr committed Jul 19, 2021
1 parent 1260005 commit 8a9ec7b
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 2 deletions.
21 changes: 21 additions & 0 deletions Vitals/Assets.xcassets/chevron-left.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "chevron-left.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
3 changes: 3 additions & 0 deletions Vitals/Assets.xcassets/chevron-left.imageset/chevron-left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions Vitals/Assets.xcassets/chevron-right.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "chevron-right.svg",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 25 additions & 2 deletions Vitals/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class ContentViewModel: ObservableObject {
}



struct ContentView: View {
@ObservedObject var viewModel: ContentViewModel

Expand All @@ -112,13 +113,35 @@ struct ContentView: View {

Spacer()

Button("􀆉") {
Button(action: {
viewModel.cycleSelectedResource(direction: -1)
}) {
ZStack {
// Extra rectangle to increase the size of the click target
Rectangle().frame(width: 14, height: 16, alignment: .center).opacity(0.0)

Image("chevron-left")
.resizable()
.scaledToFit()
.frame(maxHeight: 12)
}
}.buttonStyle(BorderlessButtonStyle())
.frame(width: 14, height: 16, alignment: .center)

Button("􀆊") {
Button(action: {
viewModel.cycleSelectedResource(direction: 1)
}) {
ZStack {
// Extra rectangle to increase the size of the click target
Rectangle().frame(width: 14, height: 16, alignment: .center).opacity(0.0)

Image("chevron-right")
.resizable()
.scaledToFit()
.frame(maxHeight: 12)
}
}.buttonStyle(BorderlessButtonStyle())
.frame(width: 14, height: 16, alignment: .center)
}.frame(height: 20)

VStack(spacing: 6) {
Expand Down

0 comments on commit 8a9ec7b

Please sign in to comment.