{"id":1471,"url":"https://github.com/Textcat/JLStickerTextView","last_synced_at":"2025-08-06T13:32:40.294Z","repository":{"id":56916229,"uuid":"56850769","full_name":"Textcat/JLStickerTextView","owner":"Textcat","description":"add text(multiple line support) to imageView, edit, rotate or resize them as you want, then render the text on image","archived":false,"fork":false,"pushed_at":"2020-05-03T11:48:56.000Z","size":29936,"stargazers_count":489,"open_issues_count":17,"forks_count":72,"subscribers_count":17,"default_branch":"master","last_synced_at":"2024-12-01T03:41:03.455Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Textcat.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}},"created_at":"2016-04-22T11:32:52.000Z","updated_at":"2024-06-30T17:13:15.000Z","dependencies_parsed_at":"2022-08-21T03:50:35.608Z","dependency_job_id":null,"html_url":"https://github.com/Textcat/JLStickerTextView","commit_stats":null,"previous_names":["luiyezheng/jlstickertextview","luiyezheng/stickertextview"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Textcat%2FJLStickerTextView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Textcat%2FJLStickerTextView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Textcat%2FJLStickerTextView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Textcat%2FJLStickerTextView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Textcat","download_url":"https://codeload.github.com/Textcat/JLStickerTextView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228905497,"owners_count":17989778,"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":[],"created_at":"2024-01-05T20:15:47.212Z","updated_at":"2024-12-09T14:30:58.294Z","avatar_url":"https://github.com/Textcat.png","language":"Swift","funding_links":[],"categories":["Media","Libs","Swift","Images [🔝](#readme)"],"sub_categories":["Image","Images"],"readme":"## About\n\nStickerTextView is an subclass of UIImageView. You can add multiple text to it, edit, rotate, resize the text as you want with one finger, then render the text on Image.\n\n![](https://github.com/Textcat/JLStickerTextView/blob/master/demoScreenshot.jpg)\n\n## Features\n* You can add multiple Text to StickerTextView at the same time\n* Multiple line Text support\n* Rotate, resize the text with one finger\n* Set the Color, alpha, font, alignment, TextShadow, lineSpacing...... of the text\n* StickerTextView also handle the process of rendering text on Image\n* Written in Swift\n\n## Installation\n\n### Manually\nJust drag the Source files into your project(**To get the latest version, please install manually**)\n\n### CocoaPods\nTo integrate StickerTextView into your Xcode project using CocoaPods, specify it in your Podfile and run `pod install`:\n\n```Ruby\nuse_frameworks!\npod \"JLStickerTextView\", \"~\u003e 0.1.1\"\n```\nTo get the latest version:\n```Ruby\nuse_frameworks!\npod \"JLStickerTextView\", :git =\u003e\n\"https://github.com/Textcat/JLStickerTextView.git\"\n```\n\n## Usage\n\n### Start\n\nFirst, import `JLStickerTextView`, then subclass the UIImageView, which you want to add text on, to JLStickerImageView, like this:\n\n```Swift\nimport JLStickerTextView\nclass ViewController: UIViewController {\n\t@IBOutlet var stickerView: JLStickerImageView!\n}\n```\n\nIf you use Storyboard, you also need connect the UIImageView to `JLStikcerImageView` Class in Identity Inspector.\n![](https://github.com/Textcat/JLStickerTextView/blob/master/Inspector.png)\n\n### Add new Label\n\nIt is quite easy to add new label to current StickerImageView:\n```Swift\nstickerView.addLabel()\n```\n\n### Set the Label\n\nYou can set the color, font , alignment, alpha.... of the label.(\u003ca href=\"#list\"\u003echeck all avaliable text attributes\u003c/a\u003e)\n\n\n```Swift\nstickerView.textColor = UIColor.whiteColor()\n```\t\t\t\n\n**Note**: when you set the properties, you make change to the current selected TextLabel.\n\n### Render Text on Image\n\nWhen you feel good, you are going to render the Text on Image and save the image:\n\n```Swift\nlet image = stickerView.renderTextOnView(stickerView)\nUIImageWriteToSavedPhotosAlbum(image!, nil, nil, nil)\n```\n\n### Customize the StickerTextView appearance \n\nCustomize stickerTextView appearance is very strightforward:\n\n```swift\n//Set the image of close Button\nstickerView.currentlyEditingLabel.closeView!.image = UIImage(named: \"cancel\")\n//Set the image of rotate Button\nstickerView.currentlyEditingLabel.rotateView?.image = UIImage(named: \"rotate\")\n//Set the border color of textLabel\nstickerView.currentlyEditingLabel.border?.strokeColor = UIColor.redColor().CGColor\n\n```\n**Note**: `closeView` and `rotateView` are both UIimageView, while `border` is CAShapeLayer\n\n### Scale stickerView  proportionally\n\nThis function is not complete yet, I just make it to fit my requirement.\n\n```\nstickerView.limitImageViewToSuperView()\n```\n\nWhen you render the text on UIImageView whose content mode is AspectFit, it is possible you will get some unwanted border. This function will scale UIImageView to fit the image. \n\n\u003ch2\u003e\u003ca id=\"list\"\u003eAvaliable Text Attributes Reference(Let's add more 😉)\u003c/a\u003e\u003c/h2\u003e\n\n|Key                                      | `JLStickerImageView` Property | value Type     |\n| ------------------------- | ------------------------------ | ------------- |\n| `Font`                                | `.fontName`                              | `String`            |\n| `Alignment`                       | `.textAlignment`                       | `NSTextAlignment` |\n| `Alpha`                              | `.textAlpha`                               | `CGFloat `      |\n| `textColor`                        | `.textColor`                                | `UIColor`        |\n| `lineSpacing`                    | `.lineSpacing`                            | `CGFloat`       |\n|`TextShadow`                    | `.textShadowOffset`                 | `CGSize`         |\n|     \t\t\t\t\t\t\t\t\t\t |\t`.textShadowColor`                  | `UIColor`        |\n|\t\t\t\t\t\t\t\t\t\t\t |\t`.textShadowBlur`                    | `CGFloat`       |\t\t\n\n## Contributon\n\nAny suggestion, request, pull are welcome. If you encounter any problem, feel free to create an issue.\n\nIf you want to add more text attributes:\n\n1. Please fork this project\n2. Define the attribute you want in `JLAttributedTextView.swift` \n3. implement user interface in `JLStickerImageVIew.swift`\n4. Write appropriate docs and comments in the README.md\n5. Submit a pull request\n\n## Plan\n\nHere are some ideas:\n\n- [ ] More options for text(eg: lineSpacing)\n- [x] Interface to customize the appearance of StickerLabelView(close Button, rotate button, border,etc)\n- [ ] More general solution for Scaling stickerView proportionally\n- [ ] Support placeholder\n\n## Reference\n\nBased on \n\n* [IQLabelView](https://github.com/kcandr/IQLabelView)\n\nAlso inspired by\n\n*  [TextDrawer](https://github.com/remirobert/TextDrawer)\n* [TextAttributes](https://github.com/delba/TextAttributes)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTextcat%2FJLStickerTextView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTextcat%2FJLStickerTextView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTextcat%2FJLStickerTextView/lists"}