From c73f0883bb2be8032a7351771a58e9ba480af136 Mon Sep 17 00:00:00 2001 From: Khoa Pham Date: Mon, 6 Jun 2016 00:10:47 +0200 Subject: [PATCH] Unify name --- README.md | 4 ++-- Smile.podspec | 2 +- SmileTests/Tests.swift | 4 ++-- Sources/Smile.swift | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index ddc8c63..5575ca2 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Smile.search(["GRINNING"]) // 😁, 😸 #### Search emoji flag by country code ```swift -Smile.flag("no") // 🇳🇴 +Smile.emoji(countryCode: "no") // 🇳🇴 ``` #### Search emoji by alias @@ -40,7 +40,7 @@ Smile.flag("no") // 🇳🇴 Emoji data is from https://github.com/github/gemoji/blob/master/db/emoji.json ```swift -Smile.emoji("japanese_castle" // 🏯 +Smile.emoji(alias: "japanese_castle") // 🏯 ``` ## Installation diff --git a/Smile.podspec b/Smile.podspec index 0fb9c6f..cf3ddb0 100644 --- a/Smile.podspec +++ b/Smile.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "Smile" s.summary = "Emoji in Swift" - s.version = "0.1.0" + s.version = "0.2.0" s.homepage = "https://github.com/onmyway133/Smile" s.license = 'MIT' s.author = { "Khoa Pham" => "onmyway133@gmail.com" } diff --git a/SmileTests/Tests.swift b/SmileTests/Tests.swift index cfce9f9..7ddd05d 100644 --- a/SmileTests/Tests.swift +++ b/SmileTests/Tests.swift @@ -12,9 +12,9 @@ import Smile class Tests: XCTestCase { func test() { - XCTAssertEqual(Smile.flag("no"), "🇳🇴") + XCTAssertEqual(Smile.emoji(countryCode: "no"), "🇳🇴") XCTAssertEqual(Smile.standardName("🇳🇴"), ["REGIONAL INDICATOR SYMBOL LETTER N", "REGIONAL INDICATOR SYMBOL LETTER O"]) XCTAssertEqual(Smile.search(["GRINNING"]), ["😁", "😸"]) - XCTAssertEqual(Smile.emoji("japanese_castle"), "🏯") + XCTAssertEqual(Smile.emoji(alias: "japanese_castle"), "🏯") } } diff --git a/Sources/Smile.swift b/Sources/Smile.swift index 1f59549..e7856a9 100644 --- a/Sources/Smile.swift +++ b/Sources/Smile.swift @@ -26,7 +26,7 @@ public func standardName(emoji: Character) -> [String] { /** Return emoji for an alias */ -public func emoji(alias: String) -> String? { +public func emoji(alias alias: String) -> String? { return emojiList[alias] } @@ -49,7 +49,7 @@ public func list() -> [Character] { /** Return emoji for a flag */ -public func flag(countryCode: String) -> Character { +public func emoji(countryCode countryCode: String) -> Character { let base = UnicodeScalar("🇦").value - UnicodeScalar("A").value let string = countryCode.uppercaseString.unicodeScalars.reduce("") {