├── .gitignore ├── .swift-version ├── .travis.yml ├── Example ├── Gemfile ├── Gemfile.lock ├── OcticonsKit.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── OcticonsKit-Example.xcscheme ├── OcticonsKit.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── OcticonsKit │ ├── AppDelegate.swift │ ├── Base.lproj │ │ ├── LaunchScreen.xib │ │ └── Main.storyboard │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ ├── OcticonTableViewCell.swift │ ├── Octicons.swift │ └── OcticonsTableViewController.swift ├── Podfile └── Podfile.lock ├── LICENSE ├── OcticonsKit.podspec ├── OcticonsKit.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── xcshareddata │ └── xcschemes │ └── OcticonsKit.xcscheme ├── OcticonsKit ├── Assets │ ├── .gitkeep │ ├── generator.rb │ ├── octicons.ttf │ └── octicons.txt ├── Classes │ ├── .gitkeep │ ├── Octicons.swift │ └── OcticonsKit.swift ├── Info.plist └── OcticonsKit.h ├── README.md └── Screenshots └── sample.png /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata/ 15 | *.xccheckout 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | 22 | # Bundler 23 | .bundle 24 | 25 | Carthage 26 | # We recommend against adding the Pods directory to your .gitignore. However 27 | # you should judge for yourself, the pros and cons are mentioned at: 28 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 29 | # 30 | # Note: if you ignore the Pods directory, make sure to uncomment 31 | # `pod install` in .travis.yml 32 | # 33 | Pods/ 34 | -------------------------------------------------------------------------------- /.swift-version: -------------------------------------------------------------------------------- 1 | 4.0 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | osx_image: xcode9.3 2 | language: objective-c 3 | before_install: 4 | - brew update 5 | - brew outdated carthage || brew upgrade carthage 6 | install: 7 | - gem install xcpretty --no-rdoc --no-ri --no-document --quiet 8 | script: 9 | - set -o pipefail && cd Example && bundle install && bundle exec pod install && cd ../ && xcodebuild build -workspace Example/OcticonsKit.xcworkspace -scheme OcticonsKit-Example -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty 10 | - pod lib lint --quick 11 | - carthage build --platform iOS --no-skip-current 12 | -------------------------------------------------------------------------------- /Example/Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem 'cocoapods' 4 | -------------------------------------------------------------------------------- /Example/Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | CFPropertyList (3.0.0) 5 | activesupport (4.2.10) 6 | i18n (~> 0.7) 7 | minitest (~> 5.1) 8 | thread_safe (~> 0.3, >= 0.3.4) 9 | tzinfo (~> 1.1) 10 | atomos (0.1.2) 11 | claide (1.0.2) 12 | cocoapods (1.5.3) 13 | activesupport (>= 4.0.2, < 5) 14 | claide (>= 1.0.2, < 2.0) 15 | cocoapods-core (= 1.5.3) 16 | cocoapods-deintegrate (>= 1.0.2, < 2.0) 17 | cocoapods-downloader (>= 1.2.0, < 2.0) 18 | cocoapods-plugins (>= 1.0.0, < 2.0) 19 | cocoapods-search (>= 1.0.0, < 2.0) 20 | cocoapods-stats (>= 1.0.0, < 2.0) 21 | cocoapods-trunk (>= 1.3.0, < 2.0) 22 | cocoapods-try (>= 1.1.0, < 2.0) 23 | colored2 (~> 3.1) 24 | escape (~> 0.0.4) 25 | fourflusher (~> 2.0.1) 26 | gh_inspector (~> 1.0) 27 | molinillo (~> 0.6.5) 28 | nap (~> 1.0) 29 | ruby-macho (~> 1.1) 30 | xcodeproj (>= 1.5.7, < 2.0) 31 | cocoapods-core (1.5.3) 32 | activesupport (>= 4.0.2, < 6) 33 | fuzzy_match (~> 2.0.4) 34 | nap (~> 1.0) 35 | cocoapods-deintegrate (1.0.2) 36 | cocoapods-downloader (1.2.1) 37 | cocoapods-plugins (1.0.0) 38 | nap 39 | cocoapods-search (1.0.0) 40 | cocoapods-stats (1.0.0) 41 | cocoapods-trunk (1.3.0) 42 | nap (>= 0.8, < 2.0) 43 | netrc (~> 0.11) 44 | cocoapods-try (1.1.0) 45 | colored2 (3.1.2) 46 | concurrent-ruby (1.0.5) 47 | escape (0.0.4) 48 | fourflusher (2.0.1) 49 | fuzzy_match (2.0.4) 50 | gh_inspector (1.1.3) 51 | i18n (0.9.5) 52 | concurrent-ruby (~> 1.0) 53 | minitest (5.11.3) 54 | molinillo (0.6.5) 55 | nanaimo (0.2.5) 56 | nap (1.1.0) 57 | netrc (0.11.0) 58 | ruby-macho (1.2.0) 59 | thread_safe (0.3.6) 60 | tzinfo (1.2.5) 61 | thread_safe (~> 0.1) 62 | xcodeproj (1.5.9) 63 | CFPropertyList (>= 2.3.3, < 4.0) 64 | atomos (~> 0.1.2) 65 | claide (>= 1.0.2, < 2.0) 66 | colored2 (~> 3.1) 67 | nanaimo (~> 0.2.5) 68 | 69 | PLATFORMS 70 | ruby 71 | 72 | DEPENDENCIES 73 | cocoapods 74 | 75 | BUNDLED WITH 76 | 1.16.1 77 | -------------------------------------------------------------------------------- /Example/OcticonsKit.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; }; 11 | 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; }; 12 | 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; }; 13 | 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; }; 14 | 6BE082EC4909A9412B64BDE4 /* libPods-OcticonsKit_Example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7462EB58516FC2D37CA0C577 /* libPods-OcticonsKit_Example.a */; }; 15 | DE1C06631D8DA22C00DFB1B3 /* Octicons.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE1C06621D8DA22C00DFB1B3 /* Octicons.swift */; }; 16 | DE1C06651D8DA26400DFB1B3 /* OcticonsTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE1C06641D8DA26400DFB1B3 /* OcticonsTableViewController.swift */; }; 17 | DE1C06671D8DA27E00DFB1B3 /* OcticonTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE1C06661D8DA27E00DFB1B3 /* OcticonTableViewCell.swift */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXFileReference section */ 21 | 310EECB58EB13C78683C4F92 /* Pods_OcticonsKit_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_OcticonsKit_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 22 | 39B5A2782B27BB0762C9426C /* OcticonsKit.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = OcticonsKit.podspec; path = ../OcticonsKit.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 23 | 3E4DA6345987312331923562 /* Pods-OcticonsKit_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OcticonsKit_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-OcticonsKit_Example/Pods-OcticonsKit_Example.debug.xcconfig"; sourceTree = ""; }; 24 | 607FACD01AFB9204008FA782 /* OcticonsKit_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OcticonsKit_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 25 | 607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 26 | 607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 27 | 607FACDA1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 28 | 607FACDC1AFB9204008FA782 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 29 | 607FACDF1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 30 | 7462EB58516FC2D37CA0C577 /* libPods-OcticonsKit_Example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-OcticonsKit_Example.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 31 | DE1C06621D8DA22C00DFB1B3 /* Octicons.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Octicons.swift; sourceTree = ""; }; 32 | DE1C06641D8DA26400DFB1B3 /* OcticonsTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OcticonsTableViewController.swift; sourceTree = ""; }; 33 | DE1C06661D8DA27E00DFB1B3 /* OcticonTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OcticonTableViewCell.swift; sourceTree = ""; }; 34 | E0F9D650FD8E49E54B03BD26 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 35 | EF521F44034AB275F80DF88F /* Pods-OcticonsKit_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-OcticonsKit_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-OcticonsKit_Example/Pods-OcticonsKit_Example.release.xcconfig"; sourceTree = ""; }; 36 | F77B87D456BCFBFAF570AF03 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 37 | /* End PBXFileReference section */ 38 | 39 | /* Begin PBXFrameworksBuildPhase section */ 40 | 607FACCD1AFB9204008FA782 /* Frameworks */ = { 41 | isa = PBXFrameworksBuildPhase; 42 | buildActionMask = 2147483647; 43 | files = ( 44 | 6BE082EC4909A9412B64BDE4 /* libPods-OcticonsKit_Example.a in Frameworks */, 45 | ); 46 | runOnlyForDeploymentPostprocessing = 0; 47 | }; 48 | /* End PBXFrameworksBuildPhase section */ 49 | 50 | /* Begin PBXGroup section */ 51 | 11BB2ABABFEED25EBEFAD285 /* Pods */ = { 52 | isa = PBXGroup; 53 | children = ( 54 | 3E4DA6345987312331923562 /* Pods-OcticonsKit_Example.debug.xcconfig */, 55 | EF521F44034AB275F80DF88F /* Pods-OcticonsKit_Example.release.xcconfig */, 56 | ); 57 | name = Pods; 58 | sourceTree = ""; 59 | }; 60 | 607FACC71AFB9204008FA782 = { 61 | isa = PBXGroup; 62 | children = ( 63 | 607FACF51AFB993E008FA782 /* Podspec Metadata */, 64 | 607FACD21AFB9204008FA782 /* Example for OcticonsKit */, 65 | 607FACD11AFB9204008FA782 /* Products */, 66 | 11BB2ABABFEED25EBEFAD285 /* Pods */, 67 | 96A0A7A20F88B49C3BE9B61B /* Frameworks */, 68 | ); 69 | sourceTree = ""; 70 | }; 71 | 607FACD11AFB9204008FA782 /* Products */ = { 72 | isa = PBXGroup; 73 | children = ( 74 | 607FACD01AFB9204008FA782 /* OcticonsKit_Example.app */, 75 | ); 76 | name = Products; 77 | sourceTree = ""; 78 | }; 79 | 607FACD21AFB9204008FA782 /* Example for OcticonsKit */ = { 80 | isa = PBXGroup; 81 | children = ( 82 | 607FACD51AFB9204008FA782 /* AppDelegate.swift */, 83 | 607FACD91AFB9204008FA782 /* Main.storyboard */, 84 | 607FACDC1AFB9204008FA782 /* Images.xcassets */, 85 | 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */, 86 | DE1C06621D8DA22C00DFB1B3 /* Octicons.swift */, 87 | 607FACD31AFB9204008FA782 /* Supporting Files */, 88 | DE1C06641D8DA26400DFB1B3 /* OcticonsTableViewController.swift */, 89 | DE1C06661D8DA27E00DFB1B3 /* OcticonTableViewCell.swift */, 90 | ); 91 | name = "Example for OcticonsKit"; 92 | path = OcticonsKit; 93 | sourceTree = ""; 94 | }; 95 | 607FACD31AFB9204008FA782 /* Supporting Files */ = { 96 | isa = PBXGroup; 97 | children = ( 98 | 607FACD41AFB9204008FA782 /* Info.plist */, 99 | ); 100 | name = "Supporting Files"; 101 | sourceTree = ""; 102 | }; 103 | 607FACF51AFB993E008FA782 /* Podspec Metadata */ = { 104 | isa = PBXGroup; 105 | children = ( 106 | 39B5A2782B27BB0762C9426C /* OcticonsKit.podspec */, 107 | F77B87D456BCFBFAF570AF03 /* README.md */, 108 | E0F9D650FD8E49E54B03BD26 /* LICENSE */, 109 | ); 110 | name = "Podspec Metadata"; 111 | sourceTree = ""; 112 | }; 113 | 96A0A7A20F88B49C3BE9B61B /* Frameworks */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | 310EECB58EB13C78683C4F92 /* Pods_OcticonsKit_Tests.framework */, 117 | 7462EB58516FC2D37CA0C577 /* libPods-OcticonsKit_Example.a */, 118 | ); 119 | name = Frameworks; 120 | sourceTree = ""; 121 | }; 122 | /* End PBXGroup section */ 123 | 124 | /* Begin PBXNativeTarget section */ 125 | 607FACCF1AFB9204008FA782 /* OcticonsKit_Example */ = { 126 | isa = PBXNativeTarget; 127 | buildConfigurationList = 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "OcticonsKit_Example" */; 128 | buildPhases = ( 129 | CB798AFAEC9340D6F5814DC2 /* [CP] Check Pods Manifest.lock */, 130 | 607FACCC1AFB9204008FA782 /* Sources */, 131 | 607FACCD1AFB9204008FA782 /* Frameworks */, 132 | 607FACCE1AFB9204008FA782 /* Resources */, 133 | 58AFED3EB9E2EA16DDAD89E2 /* [CP] Copy Pods Resources */, 134 | ); 135 | buildRules = ( 136 | ); 137 | dependencies = ( 138 | ); 139 | name = OcticonsKit_Example; 140 | productName = OcticonsKit; 141 | productReference = 607FACD01AFB9204008FA782 /* OcticonsKit_Example.app */; 142 | productType = "com.apple.product-type.application"; 143 | }; 144 | /* End PBXNativeTarget section */ 145 | 146 | /* Begin PBXProject section */ 147 | 607FACC81AFB9204008FA782 /* Project object */ = { 148 | isa = PBXProject; 149 | attributes = { 150 | LastSwiftUpdateCheck = 0720; 151 | LastUpgradeCheck = 0900; 152 | ORGANIZATIONNAME = CocoaPods; 153 | TargetAttributes = { 154 | 607FACCF1AFB9204008FA782 = { 155 | CreatedOnToolsVersion = 6.3.1; 156 | LastSwiftMigration = 0900; 157 | }; 158 | }; 159 | }; 160 | buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "OcticonsKit" */; 161 | compatibilityVersion = "Xcode 3.2"; 162 | developmentRegion = English; 163 | hasScannedForEncodings = 0; 164 | knownRegions = ( 165 | en, 166 | Base, 167 | ); 168 | mainGroup = 607FACC71AFB9204008FA782; 169 | productRefGroup = 607FACD11AFB9204008FA782 /* Products */; 170 | projectDirPath = ""; 171 | projectRoot = ""; 172 | targets = ( 173 | 607FACCF1AFB9204008FA782 /* OcticonsKit_Example */, 174 | ); 175 | }; 176 | /* End PBXProject section */ 177 | 178 | /* Begin PBXResourcesBuildPhase section */ 179 | 607FACCE1AFB9204008FA782 /* Resources */ = { 180 | isa = PBXResourcesBuildPhase; 181 | buildActionMask = 2147483647; 182 | files = ( 183 | 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */, 184 | 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */, 185 | 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */, 186 | ); 187 | runOnlyForDeploymentPostprocessing = 0; 188 | }; 189 | /* End PBXResourcesBuildPhase section */ 190 | 191 | /* Begin PBXShellScriptBuildPhase section */ 192 | 58AFED3EB9E2EA16DDAD89E2 /* [CP] Copy Pods Resources */ = { 193 | isa = PBXShellScriptBuildPhase; 194 | buildActionMask = 2147483647; 195 | files = ( 196 | ); 197 | inputPaths = ( 198 | "${SRCROOT}/Pods/Target Support Files/Pods-OcticonsKit_Example/Pods-OcticonsKit_Example-resources.sh", 199 | "${PODS_CONFIGURATION_BUILD_DIR}/OcticonsKit/OcticonsKit.bundle", 200 | ); 201 | name = "[CP] Copy Pods Resources"; 202 | outputPaths = ( 203 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/OcticonsKit.bundle", 204 | ); 205 | runOnlyForDeploymentPostprocessing = 0; 206 | shellPath = /bin/sh; 207 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-OcticonsKit_Example/Pods-OcticonsKit_Example-resources.sh\"\n"; 208 | showEnvVarsInLog = 0; 209 | }; 210 | CB798AFAEC9340D6F5814DC2 /* [CP] Check Pods Manifest.lock */ = { 211 | isa = PBXShellScriptBuildPhase; 212 | buildActionMask = 2147483647; 213 | files = ( 214 | ); 215 | inputPaths = ( 216 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 217 | "${PODS_ROOT}/Manifest.lock", 218 | ); 219 | name = "[CP] Check Pods Manifest.lock"; 220 | outputPaths = ( 221 | "$(DERIVED_FILE_DIR)/Pods-OcticonsKit_Example-checkManifestLockResult.txt", 222 | ); 223 | runOnlyForDeploymentPostprocessing = 0; 224 | shellPath = /bin/sh; 225 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 226 | showEnvVarsInLog = 0; 227 | }; 228 | /* End PBXShellScriptBuildPhase section */ 229 | 230 | /* Begin PBXSourcesBuildPhase section */ 231 | 607FACCC1AFB9204008FA782 /* Sources */ = { 232 | isa = PBXSourcesBuildPhase; 233 | buildActionMask = 2147483647; 234 | files = ( 235 | DE1C06651D8DA26400DFB1B3 /* OcticonsTableViewController.swift in Sources */, 236 | 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */, 237 | DE1C06631D8DA22C00DFB1B3 /* Octicons.swift in Sources */, 238 | DE1C06671D8DA27E00DFB1B3 /* OcticonTableViewCell.swift in Sources */, 239 | ); 240 | runOnlyForDeploymentPostprocessing = 0; 241 | }; 242 | /* End PBXSourcesBuildPhase section */ 243 | 244 | /* Begin PBXVariantGroup section */ 245 | 607FACD91AFB9204008FA782 /* Main.storyboard */ = { 246 | isa = PBXVariantGroup; 247 | children = ( 248 | 607FACDA1AFB9204008FA782 /* Base */, 249 | ); 250 | name = Main.storyboard; 251 | sourceTree = ""; 252 | }; 253 | 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */ = { 254 | isa = PBXVariantGroup; 255 | children = ( 256 | 607FACDF1AFB9204008FA782 /* Base */, 257 | ); 258 | name = LaunchScreen.xib; 259 | sourceTree = ""; 260 | }; 261 | /* End PBXVariantGroup section */ 262 | 263 | /* Begin XCBuildConfiguration section */ 264 | 607FACED1AFB9204008FA782 /* Debug */ = { 265 | isa = XCBuildConfiguration; 266 | buildSettings = { 267 | ALWAYS_SEARCH_USER_PATHS = NO; 268 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 269 | CLANG_CXX_LIBRARY = "libc++"; 270 | CLANG_ENABLE_MODULES = YES; 271 | CLANG_ENABLE_OBJC_ARC = YES; 272 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 273 | CLANG_WARN_BOOL_CONVERSION = YES; 274 | CLANG_WARN_COMMA = YES; 275 | CLANG_WARN_CONSTANT_CONVERSION = YES; 276 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 277 | CLANG_WARN_EMPTY_BODY = YES; 278 | CLANG_WARN_ENUM_CONVERSION = YES; 279 | CLANG_WARN_INFINITE_RECURSION = YES; 280 | CLANG_WARN_INT_CONVERSION = YES; 281 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 282 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 283 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 284 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 285 | CLANG_WARN_STRICT_PROTOTYPES = YES; 286 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 287 | CLANG_WARN_UNREACHABLE_CODE = YES; 288 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 289 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 290 | COPY_PHASE_STRIP = NO; 291 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 292 | ENABLE_STRICT_OBJC_MSGSEND = YES; 293 | ENABLE_TESTABILITY = YES; 294 | GCC_C_LANGUAGE_STANDARD = gnu99; 295 | GCC_DYNAMIC_NO_PIC = NO; 296 | GCC_NO_COMMON_BLOCKS = YES; 297 | GCC_OPTIMIZATION_LEVEL = 0; 298 | GCC_PREPROCESSOR_DEFINITIONS = ( 299 | "DEBUG=1", 300 | "$(inherited)", 301 | ); 302 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 303 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 304 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 305 | GCC_WARN_UNDECLARED_SELECTOR = YES; 306 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 307 | GCC_WARN_UNUSED_FUNCTION = YES; 308 | GCC_WARN_UNUSED_VARIABLE = YES; 309 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 310 | MTL_ENABLE_DEBUG_INFO = YES; 311 | ONLY_ACTIVE_ARCH = YES; 312 | SDKROOT = iphoneos; 313 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 314 | SWIFT_VERSION = 4.0; 315 | }; 316 | name = Debug; 317 | }; 318 | 607FACEE1AFB9204008FA782 /* Release */ = { 319 | isa = XCBuildConfiguration; 320 | buildSettings = { 321 | ALWAYS_SEARCH_USER_PATHS = NO; 322 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 323 | CLANG_CXX_LIBRARY = "libc++"; 324 | CLANG_ENABLE_MODULES = YES; 325 | CLANG_ENABLE_OBJC_ARC = YES; 326 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 327 | CLANG_WARN_BOOL_CONVERSION = YES; 328 | CLANG_WARN_COMMA = YES; 329 | CLANG_WARN_CONSTANT_CONVERSION = YES; 330 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 331 | CLANG_WARN_EMPTY_BODY = YES; 332 | CLANG_WARN_ENUM_CONVERSION = YES; 333 | CLANG_WARN_INFINITE_RECURSION = YES; 334 | CLANG_WARN_INT_CONVERSION = YES; 335 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 336 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 337 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 338 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 339 | CLANG_WARN_STRICT_PROTOTYPES = YES; 340 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 341 | CLANG_WARN_UNREACHABLE_CODE = YES; 342 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 343 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 344 | COPY_PHASE_STRIP = NO; 345 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 346 | ENABLE_NS_ASSERTIONS = NO; 347 | ENABLE_STRICT_OBJC_MSGSEND = YES; 348 | GCC_C_LANGUAGE_STANDARD = gnu99; 349 | GCC_NO_COMMON_BLOCKS = YES; 350 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 351 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 352 | GCC_WARN_UNDECLARED_SELECTOR = YES; 353 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 354 | GCC_WARN_UNUSED_FUNCTION = YES; 355 | GCC_WARN_UNUSED_VARIABLE = YES; 356 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 357 | MTL_ENABLE_DEBUG_INFO = NO; 358 | SDKROOT = iphoneos; 359 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 360 | SWIFT_VERSION = 4.0; 361 | VALIDATE_PRODUCT = YES; 362 | }; 363 | name = Release; 364 | }; 365 | 607FACF01AFB9204008FA782 /* Debug */ = { 366 | isa = XCBuildConfiguration; 367 | baseConfigurationReference = 3E4DA6345987312331923562 /* Pods-OcticonsKit_Example.debug.xcconfig */; 368 | buildSettings = { 369 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 370 | INFOPLIST_FILE = OcticonsKit/Info.plist; 371 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 372 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 373 | MODULE_NAME = ExampleApp; 374 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; 375 | PRODUCT_NAME = "$(TARGET_NAME)"; 376 | SWIFT_SWIFT3_OBJC_INFERENCE = Default; 377 | SWIFT_VERSION = 4.0; 378 | }; 379 | name = Debug; 380 | }; 381 | 607FACF11AFB9204008FA782 /* Release */ = { 382 | isa = XCBuildConfiguration; 383 | baseConfigurationReference = EF521F44034AB275F80DF88F /* Pods-OcticonsKit_Example.release.xcconfig */; 384 | buildSettings = { 385 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 386 | INFOPLIST_FILE = OcticonsKit/Info.plist; 387 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 388 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 389 | MODULE_NAME = ExampleApp; 390 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; 391 | PRODUCT_NAME = "$(TARGET_NAME)"; 392 | SWIFT_SWIFT3_OBJC_INFERENCE = Default; 393 | SWIFT_VERSION = 4.0; 394 | }; 395 | name = Release; 396 | }; 397 | /* End XCBuildConfiguration section */ 398 | 399 | /* Begin XCConfigurationList section */ 400 | 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "OcticonsKit" */ = { 401 | isa = XCConfigurationList; 402 | buildConfigurations = ( 403 | 607FACED1AFB9204008FA782 /* Debug */, 404 | 607FACEE1AFB9204008FA782 /* Release */, 405 | ); 406 | defaultConfigurationIsVisible = 0; 407 | defaultConfigurationName = Release; 408 | }; 409 | 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "OcticonsKit_Example" */ = { 410 | isa = XCConfigurationList; 411 | buildConfigurations = ( 412 | 607FACF01AFB9204008FA782 /* Debug */, 413 | 607FACF11AFB9204008FA782 /* Release */, 414 | ); 415 | defaultConfigurationIsVisible = 0; 416 | defaultConfigurationName = Release; 417 | }; 418 | /* End XCConfigurationList section */ 419 | }; 420 | rootObject = 607FACC81AFB9204008FA782 /* Project object */; 421 | } 422 | -------------------------------------------------------------------------------- /Example/OcticonsKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/OcticonsKit.xcodeproj/xcshareddata/xcschemes/OcticonsKit-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 67 | 68 | 78 | 80 | 86 | 87 | 88 | 89 | 90 | 91 | 97 | 99 | 105 | 106 | 107 | 108 | 110 | 111 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /Example/OcticonsKit.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/OcticonsKit.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/OcticonsKit/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // OcticonsKit 4 | // 5 | // Created by keita.oouchi on 09/17/2016. 6 | // Copyright (c) 2016 keita.oouchi. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool { 17 | return true 18 | } 19 | 20 | } 21 | 22 | -------------------------------------------------------------------------------- /Example/OcticonsKit/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Example/OcticonsKit/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 47 | 52 | 53 | 58 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /Example/OcticonsKit/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | } 43 | ], 44 | "info" : { 45 | "version" : 1, 46 | "author" : "xcode" 47 | } 48 | } -------------------------------------------------------------------------------- /Example/OcticonsKit/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /Example/OcticonsKit/OcticonTableViewCell.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | 3 | class OcticonTableViewCell: UITableViewCell { 4 | 5 | @IBOutlet weak var codeLabel: UILabel! 6 | @IBOutlet weak var octiconFontLabel: UILabel! 7 | @IBOutlet weak var octiconFontImageView: UIImageView! 8 | 9 | override func awakeFromNib() { 10 | super.awakeFromNib() 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /Example/OcticonsKit/Octicons.swift: -------------------------------------------------------------------------------- 1 | // 2 | // THIS FILE IS GENERATED, DO NOT MODIFY BY HAND 3 | // 4 | // Use generate.rb to generate when Octicons.txt is updated 5 | // 6 | import OcticonsKit 7 | 8 | extension Octicons { 9 | static let tuples: [(String, Octicons)] = 10 | [ 11 | ("alert", .alert), 12 | ("arrowDown", .arrowDown), 13 | ("arrowLeft", .arrowLeft), 14 | ("arrowRight", .arrowRight), 15 | ("arrowSmallDown", .arrowSmallDown), 16 | ("arrowSmallLeft", .arrowSmallLeft), 17 | ("arrowSmallRight", .arrowSmallRight), 18 | ("arrowSmallUp", .arrowSmallUp), 19 | ("arrowUp", .arrowUp), 20 | ("beaker", .beaker), 21 | ("bell", .bell), 22 | ("bold", .bold), 23 | ("book", .book), 24 | ("bookmark", .bookmark), 25 | ("briefcase", .briefcase), 26 | ("broadcast", .broadcast), 27 | ("browser", .browser), 28 | ("bug", .bug), 29 | ("calendar", .calendar), 30 | ("check", .check), 31 | ("checklist", .checklist), 32 | ("chevronDown", .chevronDown), 33 | ("chevronLeft", .chevronLeft), 34 | ("chevronRight", .chevronRight), 35 | ("chevronUp", .chevronUp), 36 | ("circleSlash", .circleSlash), 37 | ("circuitBoard", .circuitBoard), 38 | ("clippy", .clippy), 39 | ("clock", .clock), 40 | ("cloudDownload", .cloudDownload), 41 | ("cloudUpload", .cloudUpload), 42 | ("code", .code), 43 | ("commentDiscussion", .commentDiscussion), 44 | ("comment", .comment), 45 | ("creditCard", .creditCard), 46 | ("dash", .dash), 47 | ("dashboard", .dashboard), 48 | ("database", .database), 49 | ("desktopDownload", .desktopDownload), 50 | ("deviceCameraVideo", .deviceCameraVideo), 51 | ("deviceCamera", .deviceCamera), 52 | ("deviceDesktop", .deviceDesktop), 53 | ("deviceMobile", .deviceMobile), 54 | ("diffAdded", .diffAdded), 55 | ("diffIgnored", .diffIgnored), 56 | ("diffModified", .diffModified), 57 | ("diffRemoved", .diffRemoved), 58 | ("diffRenamed", .diffRenamed), 59 | ("diff", .diff), 60 | ("ellipses", .ellipses), 61 | ("ellipsis", .ellipsis), 62 | ("eye", .eye), 63 | ("fileBinary", .fileBinary), 64 | ("fileCode", .fileCode), 65 | ("fileDirectory", .fileDirectory), 66 | ("fileMedia", .fileMedia), 67 | ("filePdf", .filePdf), 68 | ("fileSubmodule", .fileSubmodule), 69 | ("fileSymlinkDirectory", .fileSymlinkDirectory), 70 | ("fileSymlinkFile", .fileSymlinkFile), 71 | ("fileText", .fileText), 72 | ("fileZip", .fileZip), 73 | ("file", .file), 74 | ("flame", .flame), 75 | ("fold", .fold), 76 | ("gear", .gear), 77 | ("gift", .gift), 78 | ("gistSecret", .gistSecret), 79 | ("gist", .gist), 80 | ("gitBranch", .gitBranch), 81 | ("gitCommit", .gitCommit), 82 | ("gitCompare", .gitCompare), 83 | ("gitMerge", .gitMerge), 84 | ("gitPullRequest", .gitPullRequest), 85 | ("globe", .globe), 86 | ("grabber", .grabber), 87 | ("graph", .graph), 88 | ("heart", .heart), 89 | ("history", .history), 90 | ("home", .home), 91 | ("horizontalRule", .horizontalRule), 92 | ("hubot", .hubot), 93 | ("inbox", .inbox), 94 | ("info", .info), 95 | ("issueClosed", .issueClosed), 96 | ("issueOpened", .issueOpened), 97 | ("issueReopened", .issueReopened), 98 | ("italic", .italic), 99 | ("jersey", .jersey), 100 | ("key", .key), 101 | ("keyboard", .keyboard), 102 | ("law", .law), 103 | ("lightBulb", .lightBulb), 104 | ("linkExternal", .linkExternal), 105 | ("link", .link), 106 | ("listOrdered", .listOrdered), 107 | ("listUnordered", .listUnordered), 108 | ("location", .location), 109 | ("lock", .lock), 110 | ("logoGist", .logoGist), 111 | ("logoGithub", .logoGithub), 112 | ("mailRead", .mailRead), 113 | ("mailReply", .mailReply), 114 | ("mail", .mail), 115 | ("markGithub", .markGithub), 116 | ("markdown", .markdown), 117 | ("megaphone", .megaphone), 118 | ("mention", .mention), 119 | ("milestone", .milestone), 120 | ("mirror", .mirror), 121 | ("mortarBoard", .mortarBoard), 122 | ("mute", .mute), 123 | ("noNewline", .noNewline), 124 | ("octoface", .octoface), 125 | ("organization", .organization), 126 | ("package", .package), 127 | ("paintcan", .paintcan), 128 | ("pencil", .pencil), 129 | ("person", .person), 130 | ("pin", .pin), 131 | ("plug", .plug), 132 | ("plusSmall", .plusSmall), 133 | ("plus", .plus), 134 | ("primitiveDot", .primitiveDot), 135 | ("primitiveSquare", .primitiveSquare), 136 | ("pulse", .pulse), 137 | ("question", .question), 138 | ("quote", .quote), 139 | ("radioTower", .radioTower), 140 | ("reply", .reply), 141 | ("repoClone", .repoClone), 142 | ("repoForcePush", .repoForcePush), 143 | ("repoForked", .repoForked), 144 | ("repoPull", .repoPull), 145 | ("repoPush", .repoPush), 146 | ("repo", .repo), 147 | ("rocket", .rocket), 148 | ("rss", .rss), 149 | ("ruby", .ruby), 150 | ("search", .search), 151 | ("server", .server), 152 | ("settings", .settings), 153 | ("shield", .shield), 154 | ("signIn", .signIn), 155 | ("signOut", .signOut), 156 | ("smiley", .smiley), 157 | ("squirrel", .squirrel), 158 | ("star", .star), 159 | ("stop", .stop), 160 | ("sync", .sync), 161 | ("tag", .tag), 162 | ("tasklist", .tasklist), 163 | ("telescope", .telescope), 164 | ("terminal", .terminal), 165 | ("textSize", .textSize), 166 | ("threeBars", .threeBars), 167 | ("thumbsdown", .thumbsdown), 168 | ("thumbsup", .thumbsup), 169 | ("tools", .tools), 170 | ("trashcan", .trashcan), 171 | ("triangleDown", .triangleDown), 172 | ("triangleLeft", .triangleLeft), 173 | ("triangleRight", .triangleRight), 174 | ("triangleUp", .triangleUp), 175 | ("unfold", .unfold), 176 | ("unmute", .unmute), 177 | ("unverified", .unverified), 178 | ("verified", .verified), 179 | ("versions", .versions), 180 | ("watch", .watch), 181 | ("x", .x), 182 | ("zap", .zap) 183 | ] 184 | } 185 | -------------------------------------------------------------------------------- /Example/OcticonsKit/OcticonsTableViewController.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import OcticonsKit 3 | 4 | class OcticonsTableViewController: UITableViewController { 5 | 6 | override func viewDidLoad() { 7 | super.viewDidLoad() 8 | } 9 | 10 | override func didReceiveMemoryWarning() { 11 | super.didReceiveMemoryWarning() 12 | } 13 | 14 | // MARK: - Table view data source 15 | 16 | override func numberOfSections(in tableView: UITableView) -> Int { 17 | return 1 18 | } 19 | 20 | override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { 21 | return Octicons.tuples.count 22 | } 23 | 24 | override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { 25 | let cell = tableView.dequeueReusableCell(withIdentifier: "OcticonTableViewCell", for: indexPath) 26 | if let cell = cell as? OcticonTableViewCell { 27 | let tuple = Octicons.tuples[indexPath.row] 28 | cell.codeLabel.text = tuple.0 29 | cell.octiconFontLabel.font = UIFont.octicon(of: 24) 30 | cell.octiconFontLabel.text = String.octicon(with: tuple.1) 31 | cell.octiconFontImageView.image = UIImage.octicon(with: tuple.1, textColor: UIColor.purple, size: CGSize(width: 24, height: 24)) 32 | } 33 | return cell 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | use_modular_headers! 2 | 3 | post_install do |installer| 4 | installer.pods_project.targets.each do |target| 5 | target.build_configurations.each do |config| 6 | config.build_settings['SWIFT_VERSION'] = '4.0' 7 | end 8 | end 9 | end 10 | 11 | target 'OcticonsKit_Example' do 12 | pod 'OcticonsKit', :path => '../' 13 | end 14 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - OcticonsKit (1.1.0) 3 | 4 | DEPENDENCIES: 5 | - OcticonsKit (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | OcticonsKit: 9 | :path: "../" 10 | 11 | SPEC CHECKSUMS: 12 | OcticonsKit: 125ae98fd146f9955682072394d26bfc484dccc8 13 | 14 | PODFILE CHECKSUM: 149ddf5c4dcf2eee67ae862fe02b9039876165d2 15 | 16 | COCOAPODS: 1.5.3 17 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 keita.oouchi 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /OcticonsKit.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'OcticonsKit' 3 | s.version = '1.1.0' 4 | s.summary = 'Octicons for Swift and Objective-C with type safed manner.' 5 | s.homepage = 'https://github.com/keitaoouchi/OcticonsKit' 6 | s.license = { :type => 'MIT', :file => 'LICENSE' } 7 | s.author = { 'keita.oouchi' => 'keita.oouchi@gmail.com' } 8 | s.source = { :git => 'https://github.com/keitaoouchi/OcticonsKit.git', :tag => s.version.to_s } 9 | 10 | s.ios.deployment_target = '8.0' 11 | s.requires_arc = true 12 | s.source_files = 'OcticonsKit/Classes/**/*' 13 | s.resource_bundles = { 14 | 'OcticonsKit' => ['OcticonsKit/Assets/*.ttf'] 15 | } 16 | end 17 | -------------------------------------------------------------------------------- /OcticonsKit.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | B4681D061D98CCE8002DD8A8 /* Octicons.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4681D041D98CCE8002DD8A8 /* Octicons.swift */; }; 11 | B4681D071D98CCE8002DD8A8 /* OcticonsKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = B4681D051D98CCE8002DD8A8 /* OcticonsKit.swift */; }; 12 | B4681D091D98CD00002DD8A8 /* octicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = B4681D081D98CD00002DD8A8 /* octicons.ttf */; }; 13 | B4681D0D1D98CD0F002DD8A8 /* OcticonsKit.h in Headers */ = {isa = PBXBuildFile; fileRef = B4681D0B1D98CD0F002DD8A8 /* OcticonsKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; 14 | /* End PBXBuildFile section */ 15 | 16 | /* Begin PBXFileReference section */ 17 | B4681D041D98CCE8002DD8A8 /* Octicons.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Octicons.swift; path = Classes/Octicons.swift; sourceTree = ""; }; 18 | B4681D051D98CCE8002DD8A8 /* OcticonsKit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = OcticonsKit.swift; path = Classes/OcticonsKit.swift; sourceTree = ""; }; 19 | B4681D081D98CD00002DD8A8 /* octicons.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = octicons.ttf; path = Assets/octicons.ttf; sourceTree = ""; }; 20 | B4681D0A1D98CD0F002DD8A8 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 21 | B4681D0B1D98CD0F002DD8A8 /* OcticonsKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OcticonsKit.h; sourceTree = ""; }; 22 | B46D9E7E1D98C8A7005B2515 /* OcticonsKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = OcticonsKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 23 | /* End PBXFileReference section */ 24 | 25 | /* Begin PBXFrameworksBuildPhase section */ 26 | B46D9E7A1D98C8A7005B2515 /* Frameworks */ = { 27 | isa = PBXFrameworksBuildPhase; 28 | buildActionMask = 2147483647; 29 | files = ( 30 | ); 31 | runOnlyForDeploymentPostprocessing = 0; 32 | }; 33 | /* End PBXFrameworksBuildPhase section */ 34 | 35 | /* Begin PBXGroup section */ 36 | B46D9E741D98C8A7005B2515 = { 37 | isa = PBXGroup; 38 | children = ( 39 | B46D9E801D98C8A7005B2515 /* OcticonsKit */, 40 | B46D9E7F1D98C8A7005B2515 /* Products */, 41 | ); 42 | sourceTree = ""; 43 | }; 44 | B46D9E7F1D98C8A7005B2515 /* Products */ = { 45 | isa = PBXGroup; 46 | children = ( 47 | B46D9E7E1D98C8A7005B2515 /* OcticonsKit.framework */, 48 | ); 49 | name = Products; 50 | sourceTree = ""; 51 | }; 52 | B46D9E801D98C8A7005B2515 /* OcticonsKit */ = { 53 | isa = PBXGroup; 54 | children = ( 55 | B4681D0A1D98CD0F002DD8A8 /* Info.plist */, 56 | B4681D0B1D98CD0F002DD8A8 /* OcticonsKit.h */, 57 | B4681D081D98CD00002DD8A8 /* octicons.ttf */, 58 | B4681D041D98CCE8002DD8A8 /* Octicons.swift */, 59 | B4681D051D98CCE8002DD8A8 /* OcticonsKit.swift */, 60 | ); 61 | path = OcticonsKit; 62 | sourceTree = ""; 63 | }; 64 | /* End PBXGroup section */ 65 | 66 | /* Begin PBXHeadersBuildPhase section */ 67 | B46D9E7B1D98C8A7005B2515 /* Headers */ = { 68 | isa = PBXHeadersBuildPhase; 69 | buildActionMask = 2147483647; 70 | files = ( 71 | B4681D0D1D98CD0F002DD8A8 /* OcticonsKit.h in Headers */, 72 | ); 73 | runOnlyForDeploymentPostprocessing = 0; 74 | }; 75 | /* End PBXHeadersBuildPhase section */ 76 | 77 | /* Begin PBXNativeTarget section */ 78 | B46D9E7D1D98C8A7005B2515 /* OcticonsKit */ = { 79 | isa = PBXNativeTarget; 80 | buildConfigurationList = B46D9E861D98C8A7005B2515 /* Build configuration list for PBXNativeTarget "OcticonsKit" */; 81 | buildPhases = ( 82 | B46D9E791D98C8A7005B2515 /* Sources */, 83 | B46D9E7A1D98C8A7005B2515 /* Frameworks */, 84 | B46D9E7B1D98C8A7005B2515 /* Headers */, 85 | B46D9E7C1D98C8A7005B2515 /* Resources */, 86 | ); 87 | buildRules = ( 88 | ); 89 | dependencies = ( 90 | ); 91 | name = OcticonsKit; 92 | productName = OcticonsKit; 93 | productReference = B46D9E7E1D98C8A7005B2515 /* OcticonsKit.framework */; 94 | productType = "com.apple.product-type.framework"; 95 | }; 96 | /* End PBXNativeTarget section */ 97 | 98 | /* Begin PBXProject section */ 99 | B46D9E751D98C8A7005B2515 /* Project object */ = { 100 | isa = PBXProject; 101 | attributes = { 102 | LastUpgradeCheck = 0900; 103 | ORGANIZATIONNAME = keitaoouchi; 104 | TargetAttributes = { 105 | B46D9E7D1D98C8A7005B2515 = { 106 | CreatedOnToolsVersion = 8.0; 107 | LastSwiftMigration = 0900; 108 | ProvisioningStyle = Manual; 109 | }; 110 | }; 111 | }; 112 | buildConfigurationList = B46D9E781D98C8A7005B2515 /* Build configuration list for PBXProject "OcticonsKit" */; 113 | compatibilityVersion = "Xcode 3.2"; 114 | developmentRegion = English; 115 | hasScannedForEncodings = 0; 116 | knownRegions = ( 117 | en, 118 | ); 119 | mainGroup = B46D9E741D98C8A7005B2515; 120 | productRefGroup = B46D9E7F1D98C8A7005B2515 /* Products */; 121 | projectDirPath = ""; 122 | projectRoot = ""; 123 | targets = ( 124 | B46D9E7D1D98C8A7005B2515 /* OcticonsKit */, 125 | ); 126 | }; 127 | /* End PBXProject section */ 128 | 129 | /* Begin PBXResourcesBuildPhase section */ 130 | B46D9E7C1D98C8A7005B2515 /* Resources */ = { 131 | isa = PBXResourcesBuildPhase; 132 | buildActionMask = 2147483647; 133 | files = ( 134 | B4681D091D98CD00002DD8A8 /* octicons.ttf in Resources */, 135 | ); 136 | runOnlyForDeploymentPostprocessing = 0; 137 | }; 138 | /* End PBXResourcesBuildPhase section */ 139 | 140 | /* Begin PBXSourcesBuildPhase section */ 141 | B46D9E791D98C8A7005B2515 /* Sources */ = { 142 | isa = PBXSourcesBuildPhase; 143 | buildActionMask = 2147483647; 144 | files = ( 145 | B4681D071D98CCE8002DD8A8 /* OcticonsKit.swift in Sources */, 146 | B4681D061D98CCE8002DD8A8 /* Octicons.swift in Sources */, 147 | ); 148 | runOnlyForDeploymentPostprocessing = 0; 149 | }; 150 | /* End PBXSourcesBuildPhase section */ 151 | 152 | /* Begin XCBuildConfiguration section */ 153 | B46D9E841D98C8A7005B2515 /* Debug */ = { 154 | isa = XCBuildConfiguration; 155 | buildSettings = { 156 | ALWAYS_SEARCH_USER_PATHS = NO; 157 | CLANG_ANALYZER_NONNULL = YES; 158 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 159 | CLANG_CXX_LIBRARY = "libc++"; 160 | CLANG_ENABLE_MODULES = YES; 161 | CLANG_ENABLE_OBJC_ARC = YES; 162 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 163 | CLANG_WARN_BOOL_CONVERSION = YES; 164 | CLANG_WARN_COMMA = YES; 165 | CLANG_WARN_CONSTANT_CONVERSION = YES; 166 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 167 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 168 | CLANG_WARN_EMPTY_BODY = YES; 169 | CLANG_WARN_ENUM_CONVERSION = YES; 170 | CLANG_WARN_INFINITE_RECURSION = YES; 171 | CLANG_WARN_INT_CONVERSION = YES; 172 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 173 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 174 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 175 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 176 | CLANG_WARN_STRICT_PROTOTYPES = YES; 177 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 178 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 179 | CLANG_WARN_UNREACHABLE_CODE = YES; 180 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 181 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 182 | COPY_PHASE_STRIP = NO; 183 | CURRENT_PROJECT_VERSION = 1; 184 | DEBUG_INFORMATION_FORMAT = dwarf; 185 | ENABLE_STRICT_OBJC_MSGSEND = YES; 186 | ENABLE_TESTABILITY = YES; 187 | GCC_C_LANGUAGE_STANDARD = gnu99; 188 | GCC_DYNAMIC_NO_PIC = NO; 189 | GCC_NO_COMMON_BLOCKS = YES; 190 | GCC_OPTIMIZATION_LEVEL = 0; 191 | GCC_PREPROCESSOR_DEFINITIONS = ( 192 | "DEBUG=1", 193 | "$(inherited)", 194 | ); 195 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 196 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 197 | GCC_WARN_UNDECLARED_SELECTOR = YES; 198 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 199 | GCC_WARN_UNUSED_FUNCTION = YES; 200 | GCC_WARN_UNUSED_VARIABLE = YES; 201 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 202 | MTL_ENABLE_DEBUG_INFO = YES; 203 | ONLY_ACTIVE_ARCH = YES; 204 | SDKROOT = iphoneos; 205 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 206 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 207 | TARGETED_DEVICE_FAMILY = "1,2"; 208 | VERSIONING_SYSTEM = "apple-generic"; 209 | VERSION_INFO_PREFIX = ""; 210 | }; 211 | name = Debug; 212 | }; 213 | B46D9E851D98C8A7005B2515 /* Release */ = { 214 | isa = XCBuildConfiguration; 215 | buildSettings = { 216 | ALWAYS_SEARCH_USER_PATHS = NO; 217 | CLANG_ANALYZER_NONNULL = YES; 218 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 219 | CLANG_CXX_LIBRARY = "libc++"; 220 | CLANG_ENABLE_MODULES = YES; 221 | CLANG_ENABLE_OBJC_ARC = YES; 222 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 223 | CLANG_WARN_BOOL_CONVERSION = YES; 224 | CLANG_WARN_COMMA = YES; 225 | CLANG_WARN_CONSTANT_CONVERSION = YES; 226 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 227 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 228 | CLANG_WARN_EMPTY_BODY = YES; 229 | CLANG_WARN_ENUM_CONVERSION = YES; 230 | CLANG_WARN_INFINITE_RECURSION = YES; 231 | CLANG_WARN_INT_CONVERSION = YES; 232 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 233 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 234 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 235 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 236 | CLANG_WARN_STRICT_PROTOTYPES = YES; 237 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 238 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 239 | CLANG_WARN_UNREACHABLE_CODE = YES; 240 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 241 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 242 | COPY_PHASE_STRIP = NO; 243 | CURRENT_PROJECT_VERSION = 1; 244 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 245 | ENABLE_NS_ASSERTIONS = NO; 246 | ENABLE_STRICT_OBJC_MSGSEND = YES; 247 | GCC_C_LANGUAGE_STANDARD = gnu99; 248 | GCC_NO_COMMON_BLOCKS = YES; 249 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 250 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 251 | GCC_WARN_UNDECLARED_SELECTOR = YES; 252 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 253 | GCC_WARN_UNUSED_FUNCTION = YES; 254 | GCC_WARN_UNUSED_VARIABLE = YES; 255 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 256 | MTL_ENABLE_DEBUG_INFO = NO; 257 | SDKROOT = iphoneos; 258 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 259 | TARGETED_DEVICE_FAMILY = "1,2"; 260 | VALIDATE_PRODUCT = YES; 261 | VERSIONING_SYSTEM = "apple-generic"; 262 | VERSION_INFO_PREFIX = ""; 263 | }; 264 | name = Release; 265 | }; 266 | B46D9E871D98C8A7005B2515 /* Debug */ = { 267 | isa = XCBuildConfiguration; 268 | buildSettings = { 269 | CLANG_ENABLE_MODULES = YES; 270 | CODE_SIGN_IDENTITY = ""; 271 | CODE_SIGN_STYLE = Manual; 272 | DEFINES_MODULE = YES; 273 | DEVELOPMENT_TEAM = ""; 274 | DYLIB_COMPATIBILITY_VERSION = 1; 275 | DYLIB_CURRENT_VERSION = 1; 276 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 277 | INFOPLIST_FILE = "$(SRCROOT)/OcticonsKit/Info.plist"; 278 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 279 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 280 | PRODUCT_BUNDLE_IDENTIFIER = com.keitaoouchi.OcticonsKit; 281 | PRODUCT_NAME = "$(TARGET_NAME)"; 282 | PROVISIONING_PROFILE_SPECIFIER = ""; 283 | SKIP_INSTALL = YES; 284 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 285 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 286 | SWIFT_VERSION = 4.0; 287 | }; 288 | name = Debug; 289 | }; 290 | B46D9E881D98C8A7005B2515 /* Release */ = { 291 | isa = XCBuildConfiguration; 292 | buildSettings = { 293 | CLANG_ENABLE_MODULES = YES; 294 | CODE_SIGN_IDENTITY = ""; 295 | CODE_SIGN_STYLE = Manual; 296 | DEFINES_MODULE = YES; 297 | DEVELOPMENT_TEAM = ""; 298 | DYLIB_COMPATIBILITY_VERSION = 1; 299 | DYLIB_CURRENT_VERSION = 1; 300 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 301 | INFOPLIST_FILE = "$(SRCROOT)/OcticonsKit/Info.plist"; 302 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 303 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 304 | PRODUCT_BUNDLE_IDENTIFIER = com.keitaoouchi.OcticonsKit; 305 | PRODUCT_NAME = "$(TARGET_NAME)"; 306 | PROVISIONING_PROFILE_SPECIFIER = ""; 307 | SKIP_INSTALL = YES; 308 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 309 | SWIFT_VERSION = 4.0; 310 | }; 311 | name = Release; 312 | }; 313 | /* End XCBuildConfiguration section */ 314 | 315 | /* Begin XCConfigurationList section */ 316 | B46D9E781D98C8A7005B2515 /* Build configuration list for PBXProject "OcticonsKit" */ = { 317 | isa = XCConfigurationList; 318 | buildConfigurations = ( 319 | B46D9E841D98C8A7005B2515 /* Debug */, 320 | B46D9E851D98C8A7005B2515 /* Release */, 321 | ); 322 | defaultConfigurationIsVisible = 0; 323 | defaultConfigurationName = Release; 324 | }; 325 | B46D9E861D98C8A7005B2515 /* Build configuration list for PBXNativeTarget "OcticonsKit" */ = { 326 | isa = XCConfigurationList; 327 | buildConfigurations = ( 328 | B46D9E871D98C8A7005B2515 /* Debug */, 329 | B46D9E881D98C8A7005B2515 /* Release */, 330 | ); 331 | defaultConfigurationIsVisible = 0; 332 | defaultConfigurationName = Release; 333 | }; 334 | /* End XCConfigurationList section */ 335 | }; 336 | rootObject = B46D9E751D98C8A7005B2515 /* Project object */; 337 | } 338 | -------------------------------------------------------------------------------- /OcticonsKit.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /OcticonsKit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /OcticonsKit.xcodeproj/xcshareddata/xcschemes/OcticonsKit.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 70 | 71 | 72 | 73 | 75 | 76 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /OcticonsKit/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keitaoouchi/OcticonsKit/f71be97090eebbbff29bcddad1b39d6ef9121494/OcticonsKit/Assets/.gitkeep -------------------------------------------------------------------------------- /OcticonsKit/Assets/generator.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | class Octicon 4 | attr_accessor :name, :code 5 | def initialize(name, code) 6 | @name = name 7 | @code = code 8 | end 9 | 10 | def code_for_enum_definition 11 | "case #{name} = \"\\u\{#{code}\}\"" 12 | end 13 | 14 | def code_for_extension 15 | "(\"#{name}\", .#{name})" 16 | end 17 | end 18 | 19 | class SwiftGen 20 | def initialize 21 | codepoints = File.open(File.expand_path('./../octicons.txt', __FILE__), 'r') 22 | @octicons_enum_file = File.expand_path('./../../Classes/Octicons.swift', __FILE__) 23 | @octicons_enum_extension_file = File.expand_path('./../../../Example/OcticonsKit/Octicons.swift', __FILE__) 24 | 25 | @icons = [] 26 | regex = /([\w-]+):before .*\:\"\\(.+)\"/ 27 | codepoints.each_line do |line| 28 | matched = line.match(regex) 29 | next unless matched 30 | old_style_name = matched[1].split('-').collect(&:capitalize).join 31 | new_style_name = old_style_name[0].downcase + old_style_name[1..-1] 32 | code = matched[2].gsub(";", "") 33 | @icons << Octicon.new(new_style_name, code) 34 | end 35 | end 36 | 37 | def gen_enum_definition 38 | File.open(@octicons_enum_file, 'w') do |file| 39 | file.puts <<-SWIFT 40 | // 41 | // THIS FILE IS GENERATED, DO NOT MODIFY BY HAND 42 | // 43 | // Use generate.rb to generate when Octicons.txt is updated 44 | // 45 | public enum Octicons: String { 46 | #{@icons.map(&:code_for_enum_definition).join("\n ")} 47 | } 48 | SWIFT 49 | end 50 | end 51 | 52 | def gen_enum_extension 53 | File.open(@octicons_enum_extension_file, 'w') do |file| 54 | file.puts <<-SWIFT 55 | // 56 | // THIS FILE IS GENERATED, DO NOT MODIFY BY HAND 57 | // 58 | // Use generate.rb to generate when Octicons.txt is updated 59 | // 60 | import OcticonsKit 61 | 62 | extension Octicons { 63 | static let tuples: [(String, Octicons)] = 64 | [ 65 | #{@icons.map(&:code_for_extension).join(",\n ") } 66 | ] 67 | } 68 | SWIFT 69 | end 70 | end 71 | end 72 | 73 | if __FILE__ == $0 74 | gen = SwiftGen.new 75 | gen.gen_enum_definition() 76 | gen.gen_enum_extension() 77 | end 78 | -------------------------------------------------------------------------------- /OcticonsKit/Assets/octicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keitaoouchi/OcticonsKit/f71be97090eebbbff29bcddad1b39d6ef9121494/OcticonsKit/Assets/octicons.ttf -------------------------------------------------------------------------------- /OcticonsKit/Assets/octicons.txt: -------------------------------------------------------------------------------- 1 | alert:before { content:"\f02d"; } 2 | 3 | arrow-down:before { content:"\f03f"; } 4 | 5 | arrow-left:before { content:"\f040"; } 6 | 7 | arrow-right:before { content:"\f03e"; } 8 | 9 | arrow-small-down:before { content:"\f0a0"; } 10 | 11 | arrow-small-left:before { content:"\f0a1"; } 12 | 13 | arrow-small-right:before { content:"\f071"; } 14 | 15 | arrow-small-up:before { content:"\f09f"; } 16 | 17 | arrow-up:before { content:"\f03d"; } 18 | 19 | beaker:before { content:"\f0dd"; } 20 | 21 | bell:before { content:"\f0de"; } 22 | 23 | bold:before { content:"\f0e2"; } 24 | 25 | book:before { content:"\f007"; } 26 | 27 | bookmark:before { content:"\f07b"; } 28 | 29 | briefcase:before { content:"\f0d3"; } 30 | 31 | broadcast:before { content:"\f048"; } 32 | 33 | browser:before { content:"\f0c5"; } 34 | 35 | bug:before { content:"\f091"; } 36 | 37 | calendar:before { content:"\f068"; } 38 | 39 | check:before { content:"\f03a"; } 40 | 41 | checklist:before { content:"\f076"; } 42 | 43 | chevron-down:before { content:"\f0a3"; } 44 | 45 | chevron-left:before { content:"\f0a4"; } 46 | 47 | chevron-right:before { content:"\f078"; } 48 | 49 | chevron-up:before { content:"\f0a2"; } 50 | 51 | circle-slash:before { content:"\f084"; } 52 | 53 | circuit-board:before { content:"\f0d6"; } 54 | 55 | clippy:before { content:"\f035"; } 56 | 57 | clock:before { content:"\f046"; } 58 | 59 | cloud-download:before { content:"\f00b"; } 60 | 61 | cloud-upload:before { content:"\f00c"; } 62 | 63 | code:before { content:"\f05f"; } 64 | 65 | comment-discussion:before { content:"\f04f"; } 66 | 67 | comment:before { content:"\f02b"; } 68 | 69 | credit-card:before { content:"\f045"; } 70 | 71 | dash:before { content:"\f0ca"; } 72 | 73 | dashboard:before { content:"\f07d"; } 74 | 75 | database:before { content:"\f096"; } 76 | 77 | desktop-download:before { content:"\f0dc"; } 78 | 79 | device-camera-video:before { content:"\f057"; } 80 | 81 | device-camera:before { content:"\f056"; } 82 | 83 | device-desktop:before { content:"\f27c"; } 84 | 85 | device-mobile:before { content:"\f038"; } 86 | 87 | diff-added:before { content:"\f06b"; } 88 | 89 | diff-ignored:before { content:"\f099"; } 90 | 91 | diff-modified:before { content:"\f06d"; } 92 | 93 | diff-removed:before { content:"\f06c"; } 94 | 95 | diff-renamed:before { content:"\f06e"; } 96 | 97 | diff:before { content:"\f04d"; } 98 | 99 | ellipses:before { content:"\f101"; } 100 | 101 | ellipsis:before { content:"\f09a"; } 102 | 103 | eye:before { content:"\f04e"; } 104 | 105 | file-binary:before { content:"\f094"; } 106 | 107 | file-code:before { content:"\f010"; } 108 | 109 | file-directory:before { content:"\f016"; } 110 | 111 | file-media:before { content:"\f012"; } 112 | 113 | file-pdf:before { content:"\f014"; } 114 | 115 | file-submodule:before { content:"\f017"; } 116 | 117 | file-symlink-directory:before { content:"\f0b1"; } 118 | 119 | file-symlink-file:before { content:"\f0b0"; } 120 | 121 | file-text:before { content:"\f011"; } 122 | 123 | file-zip:before { content:"\f013"; } 124 | 125 | file:before { content:"\f102"; } 126 | 127 | flame:before { content:"\f0d2"; } 128 | 129 | fold:before { content:"\f0cc"; } 130 | 131 | gear:before { content:"\f02f"; } 132 | 133 | gift:before { content:"\f042"; } 134 | 135 | gist-secret:before { content:"\f08c"; } 136 | 137 | gist:before { content:"\f00e"; } 138 | 139 | git-branch:before { content:"\f020"; } 140 | 141 | git-commit:before { content:"\f01f"; } 142 | 143 | git-compare:before { content:"\f0ac"; } 144 | 145 | git-merge:before { content:"\f023"; } 146 | 147 | git-pull-request:before { content:"\f009"; } 148 | 149 | globe:before { content:"\f0b6"; } 150 | 151 | grabber:before { content:"\f103"; } 152 | 153 | graph:before { content:"\f043"; } 154 | 155 | heart:before { content:"\2665"; } 156 | 157 | history:before { content:"\f07e"; } 158 | 159 | home:before { content:"\f08d"; } 160 | 161 | horizontal-rule:before { content:"\f070"; } 162 | 163 | hubot:before { content:"\f09d"; } 164 | 165 | inbox:before { content:"\f0cf"; } 166 | 167 | info:before { content:"\f059"; } 168 | 169 | issue-closed:before { content:"\f028"; } 170 | 171 | issue-opened:before { content:"\f026"; } 172 | 173 | issue-reopened:before { content:"\f027"; } 174 | 175 | italic:before { content:"\f0e4"; } 176 | 177 | jersey:before { content:"\f019"; } 178 | 179 | key:before { content:"\f049"; } 180 | 181 | keyboard:before { content:"\f00d"; } 182 | 183 | law:before { content:"\f0d8"; } 184 | 185 | light-bulb:before { content:"\f000"; } 186 | 187 | link-external:before { content:"\f07f"; } 188 | 189 | link:before { content:"\f05c"; } 190 | 191 | list-ordered:before { content:"\f062"; } 192 | 193 | list-unordered:before { content:"\f061"; } 194 | 195 | location:before { content:"\f060"; } 196 | 197 | lock:before { content:"\f06a"; } 198 | 199 | logo-gist:before { content:"\f0ad"; } 200 | 201 | logo-github:before { content:"\f092"; } 202 | 203 | mail-read:before { content:"\f03c"; } 204 | 205 | mail-reply:before { content:"\f051"; } 206 | 207 | mail:before { content:"\f03b"; } 208 | 209 | mark-github:before { content:"\f00a"; } 210 | 211 | markdown:before { content:"\f0c9"; } 212 | 213 | megaphone:before { content:"\f077"; } 214 | 215 | mention:before { content:"\f0be"; } 216 | 217 | milestone:before { content:"\f075"; } 218 | 219 | mirror:before { content:"\f024"; } 220 | 221 | mortar-board:before { content:"\f0d7"; } 222 | 223 | mute:before { content:"\f080"; } 224 | 225 | no-newline:before { content:"\f09c"; } 226 | 227 | octoface:before { content:"\f008"; } 228 | 229 | organization:before { content:"\f037"; } 230 | 231 | package:before { content:"\f0c4"; } 232 | 233 | paintcan:before { content:"\f0d1"; } 234 | 235 | pencil:before { content:"\f058"; } 236 | 237 | person:before { content:"\f018"; } 238 | 239 | pin:before { content:"\f041"; } 240 | 241 | plug:before { content:"\f0d4"; } 242 | 243 | plus-small:before { content:"\f104"; } 244 | 245 | plus:before { content:"\f05d"; } 246 | 247 | primitive-dot:before { content:"\f052"; } 248 | 249 | primitive-square:before { content:"\f053"; } 250 | 251 | pulse:before { content:"\f085"; } 252 | 253 | question:before { content:"\f02c"; } 254 | 255 | quote:before { content:"\f063"; } 256 | 257 | radio-tower:before { content:"\f030"; } 258 | 259 | reply:before { content:"\f105"; } 260 | 261 | repo-clone:before { content:"\f04c"; } 262 | 263 | repo-force-push:before { content:"\f04a"; } 264 | 265 | repo-forked:before { content:"\f002"; } 266 | 267 | repo-pull:before { content:"\f006"; } 268 | 269 | repo-push:before { content:"\f005"; } 270 | 271 | repo:before { content:"\f001"; } 272 | 273 | rocket:before { content:"\f033"; } 274 | 275 | rss:before { content:"\f034"; } 276 | 277 | ruby:before { content:"\f047"; } 278 | 279 | search:before { content:"\f02e"; } 280 | 281 | server:before { content:"\f097"; } 282 | 283 | settings:before { content:"\f07c"; } 284 | 285 | shield:before { content:"\f0e1"; } 286 | 287 | sign-in:before { content:"\f036"; } 288 | 289 | sign-out:before { content:"\f032"; } 290 | 291 | smiley:before { content:"\f0e7"; } 292 | 293 | squirrel:before { content:"\f0b2"; } 294 | 295 | star:before { content:"\f02a"; } 296 | 297 | stop:before { content:"\f08f"; } 298 | 299 | sync:before { content:"\f087"; } 300 | 301 | tag:before { content:"\f015"; } 302 | 303 | tasklist:before { content:"\f0e5"; } 304 | 305 | telescope:before { content:"\f088"; } 306 | 307 | terminal:before { content:"\f0c8"; } 308 | 309 | text-size:before { content:"\f0e3"; } 310 | 311 | three-bars:before { content:"\f05e"; } 312 | 313 | thumbsdown:before { content:"\f0db"; } 314 | 315 | thumbsup:before { content:"\f0da"; } 316 | 317 | tools:before { content:"\f031"; } 318 | 319 | trashcan:before { content:"\f0d0"; } 320 | 321 | triangle-down:before { content:"\f05b"; } 322 | 323 | triangle-left:before { content:"\f044"; } 324 | 325 | triangle-right:before { content:"\f05a"; } 326 | 327 | triangle-up:before { content:"\f0aa"; } 328 | 329 | unfold:before { content:"\f039"; } 330 | 331 | unmute:before { content:"\f0ba"; } 332 | 333 | unverified:before { content:"\f0e8"; } 334 | 335 | verified:before { content:"\f0e6"; } 336 | 337 | versions:before { content:"\f064"; } 338 | 339 | watch:before { content:"\f0e0"; } 340 | 341 | x:before { content:"\f081"; } 342 | 343 | zap:before { content:"\26a1"; } 344 | -------------------------------------------------------------------------------- /OcticonsKit/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keitaoouchi/OcticonsKit/f71be97090eebbbff29bcddad1b39d6ef9121494/OcticonsKit/Classes/.gitkeep -------------------------------------------------------------------------------- /OcticonsKit/Classes/Octicons.swift: -------------------------------------------------------------------------------- 1 | // 2 | // THIS FILE IS GENERATED, DO NOT MODIFY BY HAND 3 | // 4 | // Use generate.rb to generate when Octicons.txt is updated 5 | // 6 | public enum Octicons: String { 7 | case alert = "\u{f02d}" 8 | case arrowDown = "\u{f03f}" 9 | case arrowLeft = "\u{f040}" 10 | case arrowRight = "\u{f03e}" 11 | case arrowSmallDown = "\u{f0a0}" 12 | case arrowSmallLeft = "\u{f0a1}" 13 | case arrowSmallRight = "\u{f071}" 14 | case arrowSmallUp = "\u{f09f}" 15 | case arrowUp = "\u{f03d}" 16 | case beaker = "\u{f0dd}" 17 | case bell = "\u{f0de}" 18 | case bold = "\u{f0e2}" 19 | case book = "\u{f007}" 20 | case bookmark = "\u{f07b}" 21 | case briefcase = "\u{f0d3}" 22 | case broadcast = "\u{f048}" 23 | case browser = "\u{f0c5}" 24 | case bug = "\u{f091}" 25 | case calendar = "\u{f068}" 26 | case check = "\u{f03a}" 27 | case checklist = "\u{f076}" 28 | case chevronDown = "\u{f0a3}" 29 | case chevronLeft = "\u{f0a4}" 30 | case chevronRight = "\u{f078}" 31 | case chevronUp = "\u{f0a2}" 32 | case circleSlash = "\u{f084}" 33 | case circuitBoard = "\u{f0d6}" 34 | case clippy = "\u{f035}" 35 | case clock = "\u{f046}" 36 | case cloudDownload = "\u{f00b}" 37 | case cloudUpload = "\u{f00c}" 38 | case code = "\u{f05f}" 39 | case commentDiscussion = "\u{f04f}" 40 | case comment = "\u{f02b}" 41 | case creditCard = "\u{f045}" 42 | case dash = "\u{f0ca}" 43 | case dashboard = "\u{f07d}" 44 | case database = "\u{f096}" 45 | case desktopDownload = "\u{f0dc}" 46 | case deviceCameraVideo = "\u{f057}" 47 | case deviceCamera = "\u{f056}" 48 | case deviceDesktop = "\u{f27c}" 49 | case deviceMobile = "\u{f038}" 50 | case diffAdded = "\u{f06b}" 51 | case diffIgnored = "\u{f099}" 52 | case diffModified = "\u{f06d}" 53 | case diffRemoved = "\u{f06c}" 54 | case diffRenamed = "\u{f06e}" 55 | case diff = "\u{f04d}" 56 | case ellipses = "\u{f101}" 57 | case ellipsis = "\u{f09a}" 58 | case eye = "\u{f04e}" 59 | case fileBinary = "\u{f094}" 60 | case fileCode = "\u{f010}" 61 | case fileDirectory = "\u{f016}" 62 | case fileMedia = "\u{f012}" 63 | case filePdf = "\u{f014}" 64 | case fileSubmodule = "\u{f017}" 65 | case fileSymlinkDirectory = "\u{f0b1}" 66 | case fileSymlinkFile = "\u{f0b0}" 67 | case fileText = "\u{f011}" 68 | case fileZip = "\u{f013}" 69 | case file = "\u{f102}" 70 | case flame = "\u{f0d2}" 71 | case fold = "\u{f0cc}" 72 | case gear = "\u{f02f}" 73 | case gift = "\u{f042}" 74 | case gistSecret = "\u{f08c}" 75 | case gist = "\u{f00e}" 76 | case gitBranch = "\u{f020}" 77 | case gitCommit = "\u{f01f}" 78 | case gitCompare = "\u{f0ac}" 79 | case gitMerge = "\u{f023}" 80 | case gitPullRequest = "\u{f009}" 81 | case globe = "\u{f0b6}" 82 | case grabber = "\u{f103}" 83 | case graph = "\u{f043}" 84 | case heart = "\u{2665}" 85 | case history = "\u{f07e}" 86 | case home = "\u{f08d}" 87 | case horizontalRule = "\u{f070}" 88 | case hubot = "\u{f09d}" 89 | case inbox = "\u{f0cf}" 90 | case info = "\u{f059}" 91 | case issueClosed = "\u{f028}" 92 | case issueOpened = "\u{f026}" 93 | case issueReopened = "\u{f027}" 94 | case italic = "\u{f0e4}" 95 | case jersey = "\u{f019}" 96 | case key = "\u{f049}" 97 | case keyboard = "\u{f00d}" 98 | case law = "\u{f0d8}" 99 | case lightBulb = "\u{f000}" 100 | case linkExternal = "\u{f07f}" 101 | case link = "\u{f05c}" 102 | case listOrdered = "\u{f062}" 103 | case listUnordered = "\u{f061}" 104 | case location = "\u{f060}" 105 | case lock = "\u{f06a}" 106 | case logoGist = "\u{f0ad}" 107 | case logoGithub = "\u{f092}" 108 | case mailRead = "\u{f03c}" 109 | case mailReply = "\u{f051}" 110 | case mail = "\u{f03b}" 111 | case markGithub = "\u{f00a}" 112 | case markdown = "\u{f0c9}" 113 | case megaphone = "\u{f077}" 114 | case mention = "\u{f0be}" 115 | case milestone = "\u{f075}" 116 | case mirror = "\u{f024}" 117 | case mortarBoard = "\u{f0d7}" 118 | case mute = "\u{f080}" 119 | case noNewline = "\u{f09c}" 120 | case octoface = "\u{f008}" 121 | case organization = "\u{f037}" 122 | case package = "\u{f0c4}" 123 | case paintcan = "\u{f0d1}" 124 | case pencil = "\u{f058}" 125 | case person = "\u{f018}" 126 | case pin = "\u{f041}" 127 | case plug = "\u{f0d4}" 128 | case plusSmall = "\u{f104}" 129 | case plus = "\u{f05d}" 130 | case primitiveDot = "\u{f052}" 131 | case primitiveSquare = "\u{f053}" 132 | case pulse = "\u{f085}" 133 | case question = "\u{f02c}" 134 | case quote = "\u{f063}" 135 | case radioTower = "\u{f030}" 136 | case reply = "\u{f105}" 137 | case repoClone = "\u{f04c}" 138 | case repoForcePush = "\u{f04a}" 139 | case repoForked = "\u{f002}" 140 | case repoPull = "\u{f006}" 141 | case repoPush = "\u{f005}" 142 | case repo = "\u{f001}" 143 | case rocket = "\u{f033}" 144 | case rss = "\u{f034}" 145 | case ruby = "\u{f047}" 146 | case search = "\u{f02e}" 147 | case server = "\u{f097}" 148 | case settings = "\u{f07c}" 149 | case shield = "\u{f0e1}" 150 | case signIn = "\u{f036}" 151 | case signOut = "\u{f032}" 152 | case smiley = "\u{f0e7}" 153 | case squirrel = "\u{f0b2}" 154 | case star = "\u{f02a}" 155 | case stop = "\u{f08f}" 156 | case sync = "\u{f087}" 157 | case tag = "\u{f015}" 158 | case tasklist = "\u{f0e5}" 159 | case telescope = "\u{f088}" 160 | case terminal = "\u{f0c8}" 161 | case textSize = "\u{f0e3}" 162 | case threeBars = "\u{f05e}" 163 | case thumbsdown = "\u{f0db}" 164 | case thumbsup = "\u{f0da}" 165 | case tools = "\u{f031}" 166 | case trashcan = "\u{f0d0}" 167 | case triangleDown = "\u{f05b}" 168 | case triangleLeft = "\u{f044}" 169 | case triangleRight = "\u{f05a}" 170 | case triangleUp = "\u{f0aa}" 171 | case unfold = "\u{f039}" 172 | case unmute = "\u{f0ba}" 173 | case unverified = "\u{f0e8}" 174 | case verified = "\u{f0e6}" 175 | case versions = "\u{f064}" 176 | case watch = "\u{f0e0}" 177 | case x = "\u{f081}" 178 | case zap = "\u{26a1}" 179 | } 180 | -------------------------------------------------------------------------------- /OcticonsKit/Classes/OcticonsKit.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import CoreText 3 | 4 | /// A Octicons extension to UIFont. 5 | public extension UIFont { 6 | 7 | /// Get a UIFont object of Octicons. 8 | /// 9 | /// - parameter size: The preferred font size. 10 | /// - returns: A UIFont object of Octicons. 11 | public class func octicon(of size: CGFloat) -> UIFont { 12 | let name = "octicons" 13 | if UIFont.fontNames(forFamilyName: name).isEmpty { 14 | FontLoader.load(name) 15 | } 16 | 17 | return UIFont(name: name, size: size)! 18 | } 19 | } 20 | 21 | /// A Octicons extension to String. 22 | public extension String { 23 | 24 | /// Get a Octicons icon string with the given icon name. 25 | /// 26 | /// - parameter name: The preferred icon name. 27 | /// - returns: A string that will appear as icon with Octicons. 28 | public static func octicon(with name: Octicons) -> String { 29 | let substr = name.rawValue[.. UIImage { 49 | 50 | let paragraph = NSMutableParagraphStyle() 51 | paragraph.alignment = NSTextAlignment.center 52 | let fontSize = min(size.width, size.height) 53 | 54 | let attributedString = NSAttributedString( 55 | string: String.octicon(with: name), 56 | attributes: [ 57 | NSAttributedStringKey.font: UIFont.octicon(of: fontSize), 58 | NSAttributedStringKey.foregroundColor: textColor, 59 | NSAttributedStringKey.backgroundColor: backgroundColor, 60 | NSAttributedStringKey.paragraphStyle: paragraph 61 | ] 62 | ) 63 | 64 | UIGraphicsBeginImageContextWithOptions(size, false , 0.0) 65 | attributedString.draw(in: 66 | CGRect( 67 | x: 0, 68 | y: (size.height - fontSize) / 2, 69 | width: size.width, 70 | height: fontSize 71 | ) 72 | ) 73 | let image = UIGraphicsGetImageFromCurrentImageContext() 74 | UIGraphicsEndImageContext() 75 | 76 | return image! 77 | } 78 | 79 | } 80 | 81 | private class FontLoader { 82 | class func load(_ name: String) { 83 | let bundle = Bundle(for: FontLoader.self) 84 | let fontURL: URL? = 85 | bundle.url(forResource: name, withExtension: "ttf") ?? 86 | bundle.url(forResource: name, withExtension: "ttf", subdirectory: "OcticonsKit.bundle") 87 | 88 | let data = try! Data(contentsOf: fontURL!) 89 | 90 | let provider = CGDataProvider(data: data as CFData)! 91 | let font = CGFont(provider)! 92 | 93 | var error: Unmanaged? 94 | if !CTFontManagerRegisterGraphicsFont(font, &error) { 95 | let errorDescription: CFString = CFErrorCopyDescription(error!.takeUnretainedValue()) 96 | let nsError = error!.takeUnretainedValue() as AnyObject as! NSError 97 | NSException( 98 | name: NSExceptionName.internalInconsistencyException, 99 | reason: errorDescription as String, 100 | userInfo: [NSUnderlyingErrorKey: nsError] 101 | ).raise() 102 | } 103 | } 104 | } 105 | 106 | -------------------------------------------------------------------------------- /OcticonsKit/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /OcticonsKit/OcticonsKit.h: -------------------------------------------------------------------------------- 1 | // 2 | // OcticonsKit.h 3 | // OcticonsKit 4 | // 5 | // Created by Keita Ouchi on 2016/09/26. 6 | // Copyright © 2016年 keitaoouchi. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for OcticonsKit. 12 | FOUNDATION_EXPORT double OcticonsKitVersionNumber; 13 | 14 | //! Project version string for OcticonsKit. 15 | FOUNDATION_EXPORT const unsigned char OcticonsKitVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OcticonsKit 2 | 3 | [![CI Status](http://img.shields.io/travis/keitaoouchi/OcticonsKit.svg?style=flat)](https://travis-ci.org/keitaoouchi/OcticonsKit) 4 | [![Swift 4.0](https://img.shields.io/badge/Swift-4.0-orange.svg?style=flat)](https://swift.org/) 5 | [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) 6 | [![Version](https://img.shields.io/cocoapods/v/OcticonsKit.svg?style=flat)](http://cocoapods.org/pods/OcticonsKit) 7 | [![License](https://img.shields.io/cocoapods/l/OcticonsKit.svg?style=flat)](http://cocoapods.org/pods/OcticonsKit) 8 | [![Platform](https://img.shields.io/cocoapods/p/OcticonsKit.svg?style=flat)](http://cocoapods.org/pods/OcticonsKit) 9 | 10 | 11 | 12 | > OcticonsKit internally use octicons.ttf v4.3.0 13 | 14 | ## Example 15 | 16 | To run the example project, clone the repo, and run `pod install` from the Example directory first. 17 | 18 | ### octicons as UILabel 19 | 20 | ```swift 21 | someLabel.font = UIFont.octicon(of: 18) 22 | someLabel.text = String.octicon(with: .flame) 23 | ``` 24 | 25 | ### octicons as UIImage 26 | 27 | ```swift 28 | someImageView.image = UIImage.octicon(with: .flame, textColor: UIColor.orange, size: CGSize(width: 18, height: 18)) 29 | ``` 30 | 31 | For another icons, plaease see the [source](https://github.com/keitaoouchi/OcticonsKit/blob/master/OcticonsKit/Classes/octicons.swift), 32 | or build Example App. 33 | 34 | 35 | 36 | ## Requirements 37 | 38 | | Target | Version | 39 | |-------------------|---------| 40 | | iOS | => 8.0 | 41 | | Swift | => 4.0 | 42 | 43 | ## Installation 44 | 45 | OcticonsKit is available through [CocoaPods](http://cocoapods.org) or [Carthage](https://github.com/Carthage/Carthage). 46 | 47 | ### CocoaPods 48 | 49 | ```ruby 50 | pod "OcticonsKit" 51 | ``` 52 | 53 | ### Carthage 54 | 55 | ``` 56 | github "keitaoouchi/OcticonsKit" 57 | ``` 58 | 59 | for detail, please follow the [Carthage Instruction](https://github.com/Carthage/Carthage#if-youre-building-for-ios-tvos-or-watchos) 60 | 61 | ## Author 62 | 63 | keita.oouchi, keita.oouchi@gmail.com 64 | 65 | ## License 66 | 67 | [octicons.ttf](https://octicons.github.com/) file is licensed under [MIT license](https://github.com/primer/octicons/blob/master/LICENSE). 68 | When using the GitHub logos, be sure to follow the [GitHub logo guidelines](https://github.com/logos). 69 | 70 | OcticonsKit is available under the MIT license. See the LICENSE file for more info. 71 | -------------------------------------------------------------------------------- /Screenshots/sample.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/keitaoouchi/OcticonsKit/f71be97090eebbbff29bcddad1b39d6ef9121494/Screenshots/sample.png --------------------------------------------------------------------------------