From 9a3f46f91e16fb4888103cec9d5af5279b6bbe38 Mon Sep 17 00:00:00 2001 From: kenji21 Date: Wed, 2 Nov 2016 16:17:57 +0100 Subject: [PATCH] Add codebeat badge and fix font finding --- CHANGELOG.md | 3 ++- README.md | 2 +- SwiftiumKit/UIFontExtensions.swift | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa969fa..8ad0a34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased](https://github.com/openium/SwiftiumKit/compare/latest...HEAD) ### Added -travis CI configuration +travis CI configuration / badge in README +Add CodeBeat badge in README ### Changed nothing diff --git a/README.md b/README.md index f377c49..2e5bdea 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # SwiftiumKit -[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Build Status](https://travis-ci.org/openium/SwiftiumKit.svg?branch=master)](https://travis-ci.org/openium/SwiftiumKit) +[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Build Status](https://travis-ci.org/openium/SwiftiumKit.svg?branch=master)](https://travis-ci.org/openium/SwiftiumKit) [![codebeat badge](https://codebeat.co/badges/036b1ce4-7969-45e0-a903-2b7be50a0e79)](https://codebeat.co/projects/github-com-openium-swiftiumkit) This "Kit" adds many feature to speed up iOS app development. It is a rewrite of our internal ObjC Kit, but using Swift features, instead of runtime hacks. Unit tests (using given-when-expect format) and documentation are very important. diff --git a/SwiftiumKit/UIFontExtensions.swift b/SwiftiumKit/UIFontExtensions.swift index 1a1a0fb..fc0869f 100644 --- a/SwiftiumKit/UIFontExtensions.swift +++ b/SwiftiumKit/UIFontExtensions.swift @@ -25,7 +25,7 @@ extension UIFont { /** Method to get font names 'near' a given name. - Near algorithm removes '_', ' ' (space), '-' characters for searching available fonts + Near algorithm removes '_', ' ' (space), '-' characters from `fontName` for searching available fonts, if a font contains this searched name, it is added to the result array Usage example : ```` @@ -51,7 +51,7 @@ extension UIFont { simplifiedFontName = simplifiedFontName.replacingOccurrences(of: " ", with: "") simplifiedFontName = simplifiedFontName.replacingOccurrences(of: "_", with: "") simplifiedFontName = simplifiedFontName.replacingOccurrences(of: "-", with: "") - if simplifiedFontName == searchedFontName { + if simplifiedFontName.contains(searchedFontName) { maybeFontNames.append(fontName) } }