{"id":22600602,"url":"https://github.com/status302/CuteAttribute","last_synced_at":"2025-08-05T09:32:02.996Z","repository":{"id":23920468,"uuid":"100171823","full_name":"status302/CuteAttribute","owner":"status302","description":"An elegant way to deal with attributed string in swift.","archived":false,"fork":false,"pushed_at":"2022-06-10T22:47:35.000Z","size":638,"stargazers_count":65,"open_issues_count":1,"forks_count":13,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-03-15T09:51:28.467Z","etag":null,"topics":["attributedstring","ios","nsattributedstring","nsmutableattributedstring","swift-3"],"latest_commit_sha":null,"homepage":"https://cuteattribute.vsccw.com/","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/status302.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":"2017-08-13T11:22:33.000Z","updated_at":"2024-01-20T21:11:55.000Z","dependencies_parsed_at":"2022-08-20T19:50:26.691Z","dependency_job_id":null,"html_url":"https://github.com/status302/CuteAttribute","commit_stats":null,"previous_names":["qiuncheng/cuteattribute"],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/status302%2FCuteAttribute","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/status302%2FCuteAttribute/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/status302%2FCuteAttribute/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/status302%2FCuteAttribute/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/status302","download_url":"https://codeload.github.com/status302/CuteAttribute/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228610944,"owners_count":17945329,"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":["attributedstring","ios","nsattributedstring","nsmutableattributedstring","swift-3"],"created_at":"2024-12-08T12:11:14.076Z","updated_at":"2024-12-08T12:11:17.311Z","avatar_url":"https://github.com/status302.png","language":"Swift","readme":"![](https://github.com/qiuncheng/CuteAttribute/blob/master/Images/logo.png?raw=true)\nCuteAttribute\n===\n[![Build Status](https://travis-ci.org/qiuncheng/CuteAttribute.svg?branch=master)](https://travis-ci.org/qiuncheng/CuteAttribute)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![pod version](https://img.shields.io/cocoapods/v/CuteAttribute.svg)](https://cocoapods.org/pods/CuteAttribute)\n[![](https://img.shields.io/badge/Swift-4.0-yellowgreen.svg)](https://github.com/qiuncheng/CuteAttribute)\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/qiuncheng/NoticeBar/master/LICENSE)\n\nAn elegant way to deal with attributed string in swift. It's convenient to create attributed string by `.cute`, whatever from `String`, `NSString`, `NSAttributedString` or `NSMutableAttributedString`. It's so amazing that almost all methods support `chaining`. I create this project just because I met [Typeset](http://github.com/draveness/typeset) serveral days ago. But I found it's so hard to use by swift. So I made this.\n\n![](https://github.com/qiuncheng/CuteAttribute/blob/master/Images/screenshot.png?raw=true)\n\nSupport\n===\nSwift 3.0 \u0026 iOS 8+\n\nInstallation\n===\n#### Swift Package Manager\n- add it to your Xcode project.\n- Import the header file in your project.\n\n```swift\nimport CuteAttribute\n```\n\n#### CocoaPods\n- add it to your Podfile.\n\n```ruby\npod 'CuteAttribute'\n```\n- Then run the command.\n\n```shell\npod install\n```\n- Import the header file in your project.\n\n```swift\nimport CuteAttribute\n```\n\n#### Carthage\n- Add CuteAttribute to your Cartfile.\n\n```ruby\ngithub \"qiuncheng/CuteAttribute\"\n```\n- Run the command\n\n```shell\ncarthage update --platform ios\n```\n- Follow the rest of the [standard Carthage installation](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application) instructions to add CuteAttribute to your project.\n\n- Import the header file in your project.\n\n```swift\nimport CuteAttribute\n```\n\n#### Manually\n- [Download](https://github.com/qiuncheng/CuteAttribute/archive/master.zip) the full file.\n- Drag the CuteAttribute folder to your project.\n\nUsage\n===\n### Comparison\nattribute name | result | NSAttributedString | CuteAttribute\n--- | --- | --- | ---\ncolor | ![](https://github.com/qiuncheng/CuteAttribute/blob/master/Images/color.png?raw=true) | NSMutableAttributedString(string: \"hello world\", attributes: [.foregroundColor: UIColor.red]) | \"hello world\".cute.matchAll().color(.red)\nbaselineOffset | ![](https://github.com/qiuncheng/CuteAttribute/blob/master/Images/baselineOffset.png?raw=true) | NSMutableAttributedString(string: \"hello world\", attributes: [.baselineOffset: 10]) | \"hello world\".cute.matchAll().baseline(10)\nunderline | ![](https://github.com/qiuncheng/CuteAttribute/blob/master/Images/underline.png?raw=true) |  NSMutableAttributedString(string: \"hello world\", attributes: [.underlineColor: UIColor.red, .underlineStyle: NSUnderlineStyle.styleSingle.rawValue]) | \"hello world\".cute.matchAll().underline(.styleSingle).underlineColor(.red)\nfont | ![](https://github.com/qiuncheng/CuteAttribute/blob/master/Images/font.png?raw=true) | NSMutableAttributedString(string: \"hello world\", attributes: [NSAttributedStringKey.font: UIFont.systemFont(ofSize: 20)]) | \"hello world\".cute.matchAll().font(UIFont.systemFont(ofSize: 20))\nstrikethrough | ![](https://github.com/qiuncheng/CuteAttribute/blob/master/Images/strikethrough.png?raw=true) | NSMutableAttributedString(string: \"hello world\", attributes: [.strikethroughStyle: NSUnderlineStyle.styleSingle.rawValue, .strikethroughColor: UIColor.red]) | \"hello world\".cute.matchAll().strikeThrough(.styleSingle).strokeColor(.red)\nlink | ![](https://github.com/qiuncheng/CuteAttribute/blob/master/Images/link.png?raw=true) | NSMutableAttributedString(string: \"hello world\", attributes: [.link: \"https://blog.vsccw.com\"]) | \"hello world\".cute.matchAll().link(\"https://blog.vsccw.com\")\nligature | ![](https://github.com/qiuncheng/CuteAttribute/blob/master/Images/ligature.png?raw=true) | NSMutableAttributedString(string: \"hello world\", attributes: [.ligature: 1]) | \"hello world\".cute.matchAll().ligature(1)\nkern | ![](https://github.com/qiuncheng/CuteAttribute/blob/master/Images/kern.png?raw=true) | NSMutableAttributedString(string: \"hello world\", attributes: [.kern: 10]) | \"hello world\".cute.matchAll().kern(10)\nstroke | ![](https://github.com/qiuncheng/CuteAttribute/blob/master/Images/stroke.png?raw=true) | NSMutableAttributedString(string: \"hello world\", attributes: [.strokeColor: UIColor.red, .strokeWidth: 10]) | \"hello world\".cute.matchAll().strokeColor(.red).strokeWidth(10)\nshadow | `let shadow = NSShadow(); shadow.shadowColor = UIColor.red; shadow.shadowOffset = CGSize(width: 4, height: 4); shadow.shadowBlurRadius = 10;` ![](https://github.com/qiuncheng/CuteAttribute/blob/master/Images/shadow.png?raw=true) | NSMutableAttributedString(string: \"hello world\", attributes: [.shadow: shadow]) | \"hello world\".cute.matchAll().shadow(shadow)\ntextEffect | ![no image](https://github.com/qiuncheng/CuteAttribute/blob/master/Images/textEffect.png?raw=true) | \"hello world\".cute.matchAll().textEffect(\"NSTextEffectLetterpressStyle\") | \"hello world\".cute.matchAll().textEffect(\"NSTextEffectLetterpressStyle\")\nobliqueness | ![](https://github.com/qiuncheng/CuteAttribute/blob/master/Images/obliqueness.png?raw=true) | NSMutableAttributedString(string: \"hello world\", attributes: [.obliqueness: 10]) | \"hello world\".cute.matchAll().obliqueness(10)\nexpansion | ![](https://github.com/qiuncheng/CuteAttribute/blob/master/Images/expansion.png?raw=true) | NSMutableAttributedString(string: \"hello world\", attributes: [.expansion: 10]) | \"hello world\".cute.matchAll().expansion(10)\ntextAttachment | `let attachment = NSTextAttachment(); attachment.image = UIImage(named: \"hello.png\");` ![](https://github.com/qiuncheng/CuteAttribute/blob/master/Images/textAttachment.png?raw=true) | NSMutableAttributedString(string: \"hello world\", attributes: [.attachment: attachment]) | \"hello world\".cute.matchAll().textAttachment(attachment)\n\nTODO\n===\n- [x] Documented.\n- [x] Example.\n- [ ] Test.\n- [ ] More convenience.\n\nThanks\n===\n[Typeset](http://github.com/draveness/typeset) : Deal with AttributedString efficiently in `Objective-C`.\n\nLICENCE\n===\nUnder [MIT](https://github.com/qiuncheng/CuteAttribute/blob/master/LICENSE) License\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatus302%2FCuteAttribute","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstatus302%2FCuteAttribute","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatus302%2FCuteAttribute/lists"}