Skip to content

Commit

Permalink
Merge pull request #34 from ranesr/fonts/fontAwesome5
Browse files Browse the repository at this point in the history
Font Awesome 5 Support
  • Loading branch information
ranesr authored Jul 9, 2018
2 parents 458eefa + db362c9 commit 0bd216e
Show file tree
Hide file tree
Showing 21 changed files with 247 additions and 133 deletions.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.0
4.1
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
os: osx
language: swift
osx_image: xcode9
osx_image: xcode9.4

branches:
only:
- master

script:
- xcodebuild clean build test -project SwiftIcons.xcodeproj -scheme SwiftIcons -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 8,OS=11.0' CODE_SIGNING_REQUIRED=NO | xcpretty
- pod lib lint
- xcodebuild clean build test -project SwiftIcons.xcodeproj -scheme SwiftIcons -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone X,OS=11.4' CODE_SIGNING_REQUIRED=NO | xcpretty
- pod lib lint --verbose --no-clean

notifications:
email:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Add the following lines to your `Podfile`:
```ruby
target 'YourProject' do
use_frameworks!
pod 'SwiftIcons', '~> 2.0.1'
pod 'SwiftIcons', '~> 2.1.0'
end
```

Expand Down Expand Up @@ -119,7 +119,7 @@ There are different font types for each of the font icons
|:----------------:|:----------:|:--------------------:|:---------------------------------------------------:|
| Dripicons | 2.0 | dripicons | [dripicons](https://github.com/amitjakhu/dripicons) |
| Emoji | | emoji | [emoji](http://jslegers.github.io/emoji-icon-font/) |
| FontAwesome | 4.7.0 | fontAwesome | [fontAwesome](http://fontawesome.io/icons/) |
| FontAwesome | 5.1.0 | fontAwesome | [fontAwesome](https://fontawesome.com/icons?d=gallery&m=free) |
| Icofont | 1.0.0 Beta | icofont | [icofont](http://icofont.com) |
| Ionicons | 2.0.1 | ionicons | [ionicons](http://ionicons.com/) |
| Linearicons | 1.0.0 | linearIcons | [linearIcons](https://linearicons.com/free) |
Expand Down
Binary file added Source/FontAwesomeBrands.ttf
Binary file not shown.
Binary file added Source/FontAwesomeRegular.ttf
Binary file not shown.
Binary file added Source/FontAwesomeSolid.ttf
Binary file not shown.
263 changes: 177 additions & 86 deletions Source/SwiftIcons.swift

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion SwiftIcons.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'SwiftIcons'
s.version = '2.0.1'
s.version = '2.1.0'
s.summary = 'SwiftIcons - A library for using different font icons'
s.description = 'SwiftIcons library helps you use icons from any of these font icons - Dripicons, Emoji, FontAwesome, Icofont, Ionicons, Linearicons, Map-icons, Material icons, Open iconic, State face icons, Weather icons'

Expand Down
32 changes: 23 additions & 9 deletions SwiftIcons.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
A605C14D1E37AC180079765A /* MaterialIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = A605C14A1E37AC180079765A /* MaterialIcons.ttf */; };
A605C1561E37ACD80079765A /* Stateface.ttf in Resources */ = {isa = PBXBuildFile; fileRef = A605C14F1E37ACD80079765A /* Stateface.ttf */; };
A605C1571E37ACD80079765A /* OpenIconic.ttf in Resources */ = {isa = PBXBuildFile; fileRef = A605C1501E37ACD80079765A /* OpenIconic.ttf */; };
A605C1581E37ACD80079765A /* FontAwesome.ttf in Resources */ = {isa = PBXBuildFile; fileRef = A605C1511E37ACD80079765A /* FontAwesome.ttf */; };
A605C1591E37ACD80079765A /* MapIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = A605C1521E37ACD80079765A /* MapIcons.ttf */; };
A605C15A1E37ACD80079765A /* Linearicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = A605C1531E37ACD80079765A /* Linearicons.ttf */; };
A605C15B1E37ACD80079765A /* Ionicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = A605C1541E37ACD80079765A /* Ionicons.ttf */; };
Expand All @@ -33,6 +32,9 @@
A671D6811EAFBBE300849862 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = A671D6801EAFBBE300849862 /* Extensions.swift */; };
A671D6971EAFD5BA00849862 /* SwiftIconsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A671D6961EAFD5BA00849862 /* SwiftIconsTests.swift */; };
A67D28A51E42445F005765A0 /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = A67D28A41E42445F005765A0 /* LICENSE */; };
A694378720E4A65A004C9513 /* FontAwesomeSolid.ttf in Resources */ = {isa = PBXBuildFile; fileRef = A694378420E4A659004C9513 /* FontAwesomeSolid.ttf */; };
A694378820E4A65A004C9513 /* FontAwesomeBrands.ttf in Resources */ = {isa = PBXBuildFile; fileRef = A694378520E4A659004C9513 /* FontAwesomeBrands.ttf */; };
A694378920E4A65A004C9513 /* FontAwesomeRegular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = A694378620E4A659004C9513 /* FontAwesomeRegular.ttf */; };
A6945A391E8D3D87004AA743 /* SwiftIcons.podspec in Resources */ = {isa = PBXBuildFile; fileRef = A6945A381E8D3D87004AA743 /* SwiftIcons.podspec */; };
A6945A3B1E8D406B004AA743 /* .swift-version in Resources */ = {isa = PBXBuildFile; fileRef = A6945A3A1E8D406B004AA743 /* .swift-version */; };
A6BD3B1D1E96F1B000F2CF09 /* Icofont.ttf in Resources */ = {isa = PBXBuildFile; fileRef = A6BD3B1C1E96F1B000F2CF09 /* Icofont.ttf */; };
Expand Down Expand Up @@ -61,7 +63,6 @@
A605C14A1E37AC180079765A /* MaterialIcons.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = MaterialIcons.ttf; path = Source/MaterialIcons.ttf; sourceTree = "<group>"; };
A605C14F1E37ACD80079765A /* Stateface.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = Stateface.ttf; path = Source/Stateface.ttf; sourceTree = "<group>"; };
A605C1501E37ACD80079765A /* OpenIconic.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = OpenIconic.ttf; path = Source/OpenIconic.ttf; sourceTree = "<group>"; };
A605C1511E37ACD80079765A /* FontAwesome.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = FontAwesome.ttf; path = Source/FontAwesome.ttf; sourceTree = "<group>"; };
A605C1521E37ACD80079765A /* MapIcons.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = MapIcons.ttf; path = Source/MapIcons.ttf; sourceTree = "<group>"; };
A605C1531E37ACD80079765A /* Linearicons.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = Linearicons.ttf; path = Source/Linearicons.ttf; sourceTree = "<group>"; };
A605C1541E37ACD80079765A /* Ionicons.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = Ionicons.ttf; path = Source/Ionicons.ttf; sourceTree = "<group>"; };
Expand All @@ -83,6 +84,9 @@
A67D28A41E42445F005765A0 /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = SOURCE_ROOT; };
A686468B1EBB73BC00EF27A9 /* .travis.yml */ = {isa = PBXFileReference; lastKnownFileType = text; path = .travis.yml; sourceTree = SOURCE_ROOT; };
A686468C1EBB867E00EF27A9 /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = SOURCE_ROOT; };
A694378420E4A659004C9513 /* FontAwesomeSolid.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = FontAwesomeSolid.ttf; path = Source/FontAwesomeSolid.ttf; sourceTree = "<group>"; };
A694378520E4A659004C9513 /* FontAwesomeBrands.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = FontAwesomeBrands.ttf; path = Source/FontAwesomeBrands.ttf; sourceTree = "<group>"; };
A694378620E4A659004C9513 /* FontAwesomeRegular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = FontAwesomeRegular.ttf; path = Source/FontAwesomeRegular.ttf; sourceTree = "<group>"; };
A6945A381E8D3D87004AA743 /* SwiftIcons.podspec */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = SwiftIcons.podspec; sourceTree = SOURCE_ROOT; };
A6945A3A1E8D406B004AA743 /* .swift-version */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ".swift-version"; sourceTree = SOURCE_ROOT; };
A6BD3B1C1E96F1B000F2CF09 /* Icofont.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = Icofont.ttf; path = Source/Icofont.ttf; sourceTree = "<group>"; };
Expand Down Expand Up @@ -163,7 +167,9 @@
A605C1461E37AB580079765A /* SwiftIcons.swift */,
A605C15C1E37AD7A0079765A /* Dripicons.ttf */,
A605C1481E37AC180079765A /* Emoji.ttf */,
A605C1511E37ACD80079765A /* FontAwesome.ttf */,
A694378520E4A659004C9513 /* FontAwesomeBrands.ttf */,
A694378620E4A659004C9513 /* FontAwesomeRegular.ttf */,
A694378420E4A659004C9513 /* FontAwesomeSolid.ttf */,
A6BD3B1C1E96F1B000F2CF09 /* Icofont.ttf */,
A605C1541E37ACD80079765A /* Ionicons.ttf */,
A605C1531E37ACD80079765A /* Linearicons.ttf */,
Expand Down Expand Up @@ -238,7 +244,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0830;
LastUpgradeCheck = 0900;
LastUpgradeCheck = 0930;
ORGANIZATIONNAME = "Saurabh Rane";
TargetAttributes = {
A605C12F1E37A9EE0079765A = {
Expand Down Expand Up @@ -280,19 +286,21 @@
files = (
A605C15B1E37ACD80079765A /* Ionicons.ttf in Resources */,
A605C1571E37ACD80079765A /* OpenIconic.ttf in Resources */,
A605C1581E37ACD80079765A /* FontAwesome.ttf in Resources */,
A605C13E1E37A9EF0079765A /* LaunchScreen.storyboard in Resources */,
A694378920E4A65A004C9513 /* FontAwesomeRegular.ttf in Resources */,
A605C1561E37ACD80079765A /* Stateface.ttf in Resources */,
A605C15D1E37AD7A0079765A /* Dripicons.ttf in Resources */,
A605C14B1E37AC180079765A /* Emoji.ttf in Resources */,
A605C15A1E37ACD80079765A /* Linearicons.ttf in Resources */,
A605C14D1E37AC180079765A /* MaterialIcons.ttf in Resources */,
A694378720E4A65A004C9513 /* FontAwesomeSolid.ttf in Resources */,
A605C13B1E37A9EF0079765A /* Assets.xcassets in Resources */,
A67D28A51E42445F005765A0 /* LICENSE in Resources */,
A605C14C1E37AC180079765A /* WeatherIcons.ttf in Resources */,
A6945A3B1E8D406B004AA743 /* .swift-version in Resources */,
A605C1391E37A9EF0079765A /* Main.storyboard in Resources */,
A605C1591E37ACD80079765A /* MapIcons.ttf in Resources */,
A694378820E4A65A004C9513 /* FontAwesomeBrands.ttf in Resources */,
A6BD3B1D1E96F1B000F2CF09 /* Icofont.ttf in Resources */,
A6945A391E8D3D87004AA743 /* SwiftIcons.podspec in Resources */,
);
Expand Down Expand Up @@ -377,13 +385,15 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand All @@ -410,7 +420,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
IPHONEOS_DEPLOYMENT_TARGET = 11.3;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand All @@ -432,13 +442,15 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand All @@ -459,7 +471,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 10.2;
IPHONEOS_DEPLOYMENT_TARGET = 11.3;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
Expand All @@ -477,6 +489,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.ranesr.SwiftIcons;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
Expand All @@ -490,6 +503,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.ranesr.SwiftIcons;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
Expand All @@ -500,7 +514,7 @@
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
DEVELOPMENT_TEAM = YT594STPKB;
INFOPLIST_FILE = SwiftIconsTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.3;
IPHONEOS_DEPLOYMENT_TARGET = 11.3;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.ranesr.SwiftIconsTests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -516,7 +530,7 @@
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
DEVELOPMENT_TEAM = YT594STPKB;
INFOPLIST_FILE = SwiftIconsTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 10.3;
IPHONEOS_DEPLOYMENT_TARGET = 11.3;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.ranesr.SwiftIconsTests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0830"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
4 changes: 2 additions & 2 deletions SwiftIcons/AboutViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ class AboutViewController: UIViewController {
navigationController?.navigationBar.titleTextAttributes = attributes
navigationItem.hidesBackButton = true

githubBtn.setIcon(prefixText: "Learn more: ", icon: .fontAwesome(.github), iconColor: UIColor.init(hex: "3498db"), postfixText: "", forState: .normal, textSize: 16, iconSize: 30)
githubBtn.setIcon(prefixText: "Learn more: ", icon: .fontAwesomeBrands(.github), iconColor: UIColor.gray, postfixText: "", forState: .normal, textSize: 16, iconSize: 30)

madeWith.setIcon(prefixText: "Made with ", icon: .fontAwesome(.heart), iconColor: UIColor.init(hex: "e74c3c"), postfixText: " in San Francisco, California", size: 20, iconSize: 20)
madeWith.setIcon(prefixText: "Made with ", icon: .fontAwesomeSolid(.heart), iconColor: UIColor.init(hex: "e74c3c"), postfixText: " in San Francisco, California", size: 20, iconSize: 20)
}

override func didReceiveMemoryWarning() {
Expand Down
3 changes: 2 additions & 1 deletion SwiftIcons/Assets.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@
"scale" : "3x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "icon1024.png",
"scale" : "1x"
}
],
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions SwiftIcons/HomeViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ class HomeViewController: UITabBarController {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}

// Setting Tab Bar Items
override func viewWillAppear(_ animated: Bool) {
tabBar.items?[0].setIcon(icon: .icofont(.font), size: nil, textColor: .lightGray)
tabBar.items?[1].setIcon(bgIcon: .fontAwesome(.circleThin), bgTextColor: .lightGray, topIcon: .fontAwesome(.squareO), topTextColor: .lightGray, bgLarge: true, size: nil)
tabBar.items?[1].setIcon(bgIcon: .fontAwesomeRegular(.circle), bgTextColor: .lightGray, topIcon: .fontAwesomeSolid(.square), topTextColor: .lightGray, bgLarge: true, size: nil)
tabBar.items?[2].setIcon(icon: .ionicons(.iosInformation), size: nil, textColor: .lightGray)
}

// Utility Function to Get Font Family Names
func printFonts() {
let fontFamilyNames = UIFont.familyNames
Expand Down
Loading

0 comments on commit 0bd216e

Please sign in to comment.