{"id":2039,"url":"https://github.com/xoudini/emojica","last_synced_at":"2025-04-09T23:52:51.515Z","repository":{"id":14052901,"uuid":"75554625","full_name":"xoudini/emojica","owner":"xoudini","description":"A Swift framework for using custom emoji in strings.","archived":false,"fork":false,"pushed_at":"2023-08-30T16:28:46.000Z","size":552,"stargazers_count":106,"open_issues_count":4,"forks_count":15,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T23:52:39.060Z","etag":null,"topics":["emoji","emojione","emojis","ios","ios-framework","swift","swift-framework","twemoji"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xoudini.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2016-12-04T18:05:33.000Z","updated_at":"2024-03-25T17:39:43.000Z","dependencies_parsed_at":"2024-04-26T18:45:35.541Z","dependency_job_id":null,"html_url":"https://github.com/xoudini/emojica","commit_stats":{"total_commits":61,"total_committers":4,"mean_commits":15.25,"dds":0.5081967213114754,"last_synced_commit":"ce6ac068a8cd8601eaa47a4b3df8204e261d91c9"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xoudini%2Femojica","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xoudini%2Femojica/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xoudini%2Femojica/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xoudini%2Femojica/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xoudini","download_url":"https://codeload.github.com/xoudini/emojica/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248131454,"owners_count":21052819,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["emoji","emojione","emojis","ios","ios-framework","swift","swift-framework","twemoji"],"created_at":"2024-01-05T20:16:01.888Z","updated_at":"2025-04-09T23:52:51.492Z","avatar_url":"https://github.com/xoudini.png","language":"Swift","funding_links":[],"categories":["UI","Text"],"sub_categories":["Layout","Other free courses","Keychain","Other Testing"],"readme":"![emojica](https://raw.githubusercontent.com/xoudini/emojica/images/emojica.png)\n=====\n\n\u003csup\u003e\nEmojica – a Swift framework for using custom emoji in strings.\n\u003c/sup\u003e\n\n![gif](https://raw.githubusercontent.com/xoudini/emojica/images/demo.gif)\n\n## What does it do?\n\nEmojica allows you to replace the standard emoji in your iOS apps with\n[custom emoji](#compatible-image-sets).\nWorks on `UILabel` and `UITextView`.\n\nJust follow the instructions below, import your custom image set, and you're\nready to go.\n\n\n\n## Features\n\n- [x] Compatible with __all__ iOS 13 emoji\n- [x] Works with any image set\u003csup\u003e1\u003c/sup\u003e\n- [x] Safe to use even with incomplete image sets\u003csup\u003e2\u003c/sup\u003e\n- [x] Convert input directly on [`textViewDidChange(_:)`](#directly-converting-text-input)\n- [x] Revert converted strings to their original representation\n\n\u003csup\u003e\n1. The naming should follow a similar pattern as the compatible image sets.\n\u003c/sup\u003e\n\u003cbr\u003e\n\u003csup\u003e\n2. The original emoji are used as fallback.\n\u003c/sup\u003e\n\n\n\n## Requirements\n\n+ Xcode 11\n+ iOS 13.0+\n   * _Lower versions haven't been tested, although the framework may run without\n      issues on a lower version._\n+ Swift 5\n   * _Using the framework in an Objective-C project may require some\n      modifications to the source. Support for Objective-C will possibly be\n      added at some point in the future._\n\n\n\n## Installation\n\n### [CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html)\n\n1. Add the pod to your `Podfile`:\n\n ```ruby\n target '...' do\n     pod 'Emojica'\n end\n ```\n2. Navigate into your project directory and install/update:\n\n ```sh\n $ cd /Path/To/Your/Project/ \u0026\u0026 pod install\n ```\n\n### [Carthage](https://github.com/Carthage/Carthage)\n\n1. Add this to your `Cartfile`:\n\n```\ngithub \"xoudini/emojica\"\n```\n\n2. Navigate into your project directory and install/update:\n\n ```sh\n $ cd /Path/To/Your/Project/ \u0026\u0026 carthage update\n ```\n\n### [Swift Package Manager](https://github.com/apple/swift-package-manager)\n\nOpen your project use Xcode.\nClick `File` -\u003e `Add Packages`, enter repository url.\n\n```\nhttps://github.com/xoudini/emojica\n```\n\n### Manual installation\n\n1. Clone the repository, and drag `Emojica.xcodeproj` into your project\n    hierarchy in Xcode.\n2. Select your project, then select your application's target under __Targets__.\n3. Under the __General__ tab, click the __+__ under __Embedded Binaries__.\n4. Select `Emojica.frameworkiOS` and finish by pressing __Add__.\n\n \u003e If Xcode gives you a `No such module 'Emojica'` compiler error at your\n \u003e`import` statement, just build your application (or the framework) once. Also,\n \u003e each time you Clean (⇧⌘K) the project Xcode will give you the same error,\n \u003e and the solution is the same.\n\n\n\n## Usage\n\n```swift\nimport Emojica\n```\n\n### Instantiation\n\n```swift\nlet emojica = Emojica()\n\n// Creates an instance with a font.\nlet emojica = Emojica(font: UIFont.systemFont(ofSize: 17.0))\n```\n\n### Configure instance\n\n* __Set font__:\n\n   ```swift\n   emojica.font = UIFont.systemFont(ofSize: 17.0)\n   ```\n\n If no font is set, the system font is used.\n\n\n* __Set size__:\n\n   ```swift\n   emojica.pointSize = 17.0\n   ```\n\n If you're satisfied with the default font, you can just set the size.\n The value for `pointSize` is 17.0 by default.\n\n\n* __Set minimum code point width__:\n\n \u003e __NOTE__: Use this only when using a custom image set that\n \u003e [isn't handled by Emojica](#compatible-image-sets).\n\n   ```swift\n   emojica.minimumCodePointWidth = 4\n   ```\n\n A value between 0 and 8 that sets the minimum width for code point strings in\n order to correctly find the images for the custom emoji. The character `0` is\n used for padding.\n\n To find a suitable value, find the image for e.g. © (`U+00A9 COPYRIGHT SIGN`),\n and use the length of that image's name – `a9.png` has a width of 2, `00a9.png`\n has a width of 4, etc.\n\n\n* __Set separator__:\n\n \u003e __NOTE__: Use this only when using a custom image set that\n \u003e [isn't handled by Emojica](#compatible-image-sets).\n\n ```swift\n emojica.separator = \"~\"\n ```\n\n The separator used in the image names of combined code points.\n\n\n* __Set image set used in the project__:\n\n   ```swift\n   emojica.imageSet = .default\n   ```\n\n Automatically configures settings specific to the image set.\n\n\n* __Disable modifier symbols__:\n\n   ```swift\n   emojica.useModifiers = false\n   ```\n\n Strips out all [modifier symbols](http://unicode.org/reports/tr51/#Emoji_Modifiers_Table)\n from complete modifier sequences.\n\n\n* __Enable emoji to be reverted__:\n\n \u003e __NOTE__: Keep the instance non-revertible if the original strings aren't\n \u003e needed after conversion.\n\n   ```swift\n   emojica.revertible = true\n   ```\n\n Enables strings with custom emoji to be reverted to original state.\n\n\n### Convert string\n\n```swift\nlet sample: String = \"Sample text 😎\"\n\nlet converted: NSAttributedString = emojica.convert(string: sample)\n```\n\n### Revert string\n\n\u003e __NOTE__: The instance must have `revertible` set to `true`.\n\n```swift\nlet reverted: String = emojica.revert(attributedString: converted)\n```\n\n### Using converted strings\n\n```swift\nlet textView = UITextView()\n\n...\n\nlet flag: String = \"🇫🇮 \"\n\ntextView.attributedText = emojica.convert(string: flag)\n```\n\n### Directly converting text input\n\nYou can directly convert text input by implementing the `UITextViewDelegate`\nmethod `textViewDidChange(_:)` and passing the changed `UITextView` to the\nEmojica method by the same name:\n\n```swift\nfunc textViewDidChange(_ textView: UITextView) {\n    emojica.textViewDidChange(textView)\n}\n```\n\n\n\n## Compatible Image Sets\n\n\u003e The below image sets are tested, but other image sets may work just as well.\n\u003e If you have an image set that should be added to Emojica, please create an\n\u003e [__Issue__](https://github.com/xoudini/emojica/issues).\n\n| Set           | Version   | Notes                               |\n| ------------- | --------- | ----------------------------------- |\n| [Twemoji]     | v13.0     | _[Prepare](#preparations)_          |\n| [EmojiOne]    | 2.2.7     | _Missing code points_\u003csup\u003e1\u003c/sup\u003e   |\n| [Noto Emoji]  | 1.05      | _[Prepare](#preparations)_          |\n\n\u003c!-- TODO: Check newest EmojiOne and Noto --\u003e\n\u003e __NOTE__: The newest EmojiOne and Noto sets haven't been checked in a while.\n\n[Twemoji]: https://github.com/twitter/twemoji\n[EmojiOne]: https://github.com/Ranks/emojione\n[Noto Emoji]: https://github.com/googlei18n/noto-emoji\n\n\u003csup\u003e\n1. U+2640, U+2642 and U+2695 and sequences containing these characters are\nunsupported.\n\u003c/sup\u003e\n\n\n\n## Example Project\n\nThe example `EmojicaExample.xcodeproj` is set up but __does not contain\nimages__. To test the project, add your emoji images to the `Images` group and\n__Run__.\n\n\n\n## Preparations\n\n\u003e __WARNING__: Running the script __will__ overwrite the image names, so __do\n\u003e not run the script over a unique image set!__\n\n\nSome image sets may have to be slightly modified before usage. Check the table\nin [Compatible Image Sets](#compatible-image-sets) if you're using a set marked\n_Prepare_, and if you are, follow these instructions:\n\n#### 1. Copy/move the contained file `rename.sh` into the folder containing your image set.\n#### 2. Open your preferred terminal.\n#### 3. Navigate into the directory:\n```sh\n$ cd /Path/To/Your/ImageSet/\n```\n#### 4. Run the script:\n```sh\n$ sh rename.sh\n```\n\n\n\n## Contact\n\nFeedback and questions are welcome, create an\n[__Issue__](https://github.com/xoudini/emojica/issues) for bugs, problems, and\npotential feature requests.\n\nIf you end up using this framework in one of your projects, feel free to let me\nknow, e.g. on [Twitter](https://twitter.com/xoudini).\n\n\n\n## Contributions\n\nThe list of contributors to this project can be found\n[here](https://github.com/xoudini/emojica/graphs/contributors).\n\nIf you would like to contribute, don't hesitate to open an issue or a pull\nrequest.\n\n\n\n## License\n\nEmojica is released under the **Apache License 2.0**.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxoudini%2Femojica","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxoudini%2Femojica","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxoudini%2Femojica/lists"}