Skip to content

Commit

Permalink
• Added a symbol for each Category.
Browse files Browse the repository at this point in the history
	-Mainly to be used in Labels
  • Loading branch information
Rspoon3 committed Apr 22, 2021
1 parent 39c7034 commit 5f5b1d9
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions Sources/SFSymbols/SFSymbol+Category.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,68 @@ public extension SFSymbol{
public var symbols: [SFSymbol]{
return SFSymbol.allSymbols.filter({$0.categories.contains(self)})
}

public var symbol: SFSymbol{
switch self {
case .all:
return .squareGrid2X2
case .whatsNew:
return .sparkles
case .multiColor:
if #available(iOS 14, *) {
return .paintpalette
} else{
return .eyedropper
}
case .communication:
return .message
case .weather:
return .cloudSun
case .objectsAndTools:
return .folder
case .devices:
return .desktopcomputer
case .gaming:
return .gamecontroller
case .connectivity:
return .antennaRadiowavesLeftAndRight
case .transportation:
return .carFill
case .human:
return .personCropCircle
case .nature:
if #available(iOS 14, *) {
return .leaf
} else{
return .flame
}
case .editing:
return .sliderHorizontal3
case .textFormatting:
return .textformat
case .media:
return .playpause
case .keyboard:
return .command
case .commerce:
return .cart
case .time:
return .timer
case .health:
return .staroflife
case .shapes:
return .squareOnCircle
case .arrows:
if #available(iOS 14, *) {
return .arrowForward
} else{
return .arrowUturnLeft
}
case .indices:
return .aCircle
case .math:
return .xSquareroot
}
}
}
}

0 comments on commit 5f5b1d9

Please sign in to comment.