Skip to content

Commit

Permalink
Unify name
Browse files Browse the repository at this point in the history
  • Loading branch information
onmyway133 committed Jun 5, 2016
1 parent 6c88fcc commit c73f088
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ Smile.search(["GRINNING"]) // 😁, 😸
#### Search emoji flag by country code

```swift
Smile.flag("no") // πŸ‡³πŸ‡΄
Smile.emoji(countryCode: "no") // πŸ‡³πŸ‡΄
```

#### Search emoji by alias

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
Expand Down
2 changes: 1 addition & 1 deletion Smile.podspec
Original file line number Diff line number Diff line change
@@ -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" => "[email protected]" }
Expand Down
4 changes: 2 additions & 2 deletions SmileTests/Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"), "🏯")
}
}
4 changes: 2 additions & 2 deletions Sources/Smile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}

Expand All @@ -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("") {
Expand Down

0 comments on commit c73f088

Please sign in to comment.