Skip to content

Commit

Permalink
Captain Icon Set
Browse files Browse the repository at this point in the history
  • Loading branch information
segecey committed Jun 3, 2020
1 parent 10e42aa commit 89d64e8
Show file tree
Hide file tree
Showing 6 changed files with 415 additions and 7 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ To run the example project, clone the repo, and run `pod install` from the Examp
| Segoe MDL2 | sm: | [List](https://docs.microsoft.com/en-us/windows/uwp/design/style/segoe-ui-symbol-font) |
| Foundation 3 | fo: | [List](https://zurb.com/playground/foundation-icon-fonts-3) |
| Elegant Icon | el: | [List](https://www.elegantthemes.com/blog/resources/elegant-icon-font) |
| Captain | cp: | Please check Example project. |

## Fonts
````swift
Expand Down
6 changes: 6 additions & 0 deletions SwiftIconFont.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
E8E47629248855DE005275C4 /* Foundation.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8E47628248855DE005275C4 /* Foundation.swift */; };
E8E4762B24885663005275C4 /* FontAwesome5.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8E4762A24885662005275C4 /* FontAwesome5.swift */; };
E8E47631248859A4005275C4 /* ElegantIcon.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8E47630248859A4005275C4 /* ElegantIcon.swift */; };
E8E4763424885D85005275C4 /* Captain.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8E4763324885D85005275C4 /* Captain.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -110,6 +111,8 @@
E8E4762E248856CB005275C4 /* FontAwesome5Free-Solid.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "FontAwesome5Free-Solid.ttf"; sourceTree = "<group>"; };
E8E4762F24885945005275C4 /* ElegantIcons.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = ElegantIcons.ttf; sourceTree = "<group>"; };
E8E47630248859A4005275C4 /* ElegantIcon.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ElegantIcon.swift; sourceTree = "<group>"; };
E8E4763224885D4C005275C4 /* captainicon.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = captainicon.ttf; sourceTree = "<group>"; };
E8E4763324885D85005275C4 /* Captain.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Captain.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -175,6 +178,7 @@
1AF15B93209E196500E20C14 /* Segoe mdl2 assets.ttf */,
E8E4762F24885945005275C4 /* ElegantIcons.ttf */,
E8E476272488556C005275C4 /* fontcustom.ttf */,
E8E4763224885D4C005275C4 /* captainicon.ttf */,
E8E4762D248856CB005275C4 /* FontAwesome5Brands-Regular.ttf */,
E8E4762C248856CB005275C4 /* FontAwesome5Free-Regular.ttf */,
E8E4762E248856CB005275C4 /* FontAwesome5Free-Solid.ttf */,
Expand Down Expand Up @@ -246,6 +250,7 @@
1AF15B95209E198D00E20C14 /* SegoeMDL2.swift */,
E8E47628248855DE005275C4 /* Foundation.swift */,
E8E47630248859A4005275C4 /* ElegantIcon.swift */,
E8E4763324885D85005275C4 /* Captain.swift */,
);
path = Fonts;
sourceTree = "<group>";
Expand Down Expand Up @@ -376,6 +381,7 @@
DA8D9D531D345A4900F5E693 /* SwiftIconFont.swift in Sources */,
DA639C421F62B959004810A6 /* SwiftIconStepper.swift in Sources */,
DA8D9D581D345A4900F5E693 /* ThemifyIcon.swift in Sources */,
E8E4763424885D85005275C4 /* Captain.swift in Sources */,
DAD008341F90D2FC00D4FC34 /* SwiftIconFont+String.swift in Sources */,
DA8D9D551D345A4900F5E693 /* SwiftIconTabBarItem.swift in Sources */,
DA8D9D561D345A4900F5E693 /* SwiftIconTextField.swift in Sources */,
Expand Down
14 changes: 13 additions & 1 deletion SwiftIconFont/Classes/Extensions/SwiftIconFont+String.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,23 @@ public extension String {
return fontAwesome5Icon(code)
case .foundation:
return foundationIcon(code)
case .elegantIcons:
case .elegantIcon:
return elegantIcon(code)
case .captain:
return captainIcon(code)
}
}



static func captainIcon(_ code: String) -> String? {
if let icon = captainIconArr[code] {
return icon
}

return nil
}

static func elegantIcon(_ code: String) -> String? {
if let icon = elegantIconArr[code] {
return icon
Expand Down
Loading

0 comments on commit 89d64e8

Please sign in to comment.