{"id":21619054,"url":"https://github.com/bannzai/stringattribute","last_synced_at":"2025-08-09T23:06:49.957Z","repository":{"id":55876555,"uuid":"96848792","full_name":"bannzai/StringAttribute","owner":"bannzai","description":"StringAttribute is simple to write about NSAttributedString","archived":false,"fork":false,"pushed_at":"2020-12-10T11:19:49.000Z","size":2363,"stargazers_count":46,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-30T13:49:38.511Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/bannzai.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-07-11T03:56:14.000Z","updated_at":"2025-07-10T14:46:22.000Z","dependencies_parsed_at":"2022-08-15T08:20:46.190Z","dependency_job_id":null,"html_url":"https://github.com/bannzai/StringAttribute","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/bannzai/StringAttribute","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bannzai%2FStringAttribute","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bannzai%2FStringAttribute/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bannzai%2FStringAttribute/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bannzai%2FStringAttribute/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bannzai","download_url":"https://codeload.github.com/bannzai/StringAttribute/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bannzai%2FStringAttribute/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269649848,"owners_count":24453541,"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","status":"online","status_checked_at":"2025-08-09T02:00:10.424Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-24T23:07:45.875Z","updated_at":"2025-08-09T23:06:49.913Z","avatar_url":"https://github.com/bannzai.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# StringAttribute\n`StringAttribute` is simple to write about NSAttributedString.\n\n\u003cimg width=\"800px\" src=\"https://user-images.githubusercontent.com/10897361/28498050-7b14e49e-6fd0-11e7-8e75-0578e30cecb1.png\" /\u003e\n\n# Usage\nYou can write like the one below.\n\n- Initialize attributed string\n\n```swift\n \"Hello, world\".attributed() // NSAttributedString\n```\n\n- Attach attributes with method chain\n\n```swift\nlabel.attributedText = \"Hello, world\".attributed()\n    .apply(with: .foregroundColor(.white)) // All text to be white color\n    .apply(with: .foregroundColor(.blue), in: 0..\u003c5) // \"Hello\" to be blue color\n    .apply(with: [.font(UIFont.boldSystemFont(ofSize: 20)), .foregroundColor(.red)], for: \"world\") // \"world\" is to be Bold font and red color\n```\n\n- Attach paragraph style with method chain\n\n```swift\nlabel.attributedText = \"Hello, \\nworld\".attributed()\n    .apply(with: .paragraph(.complex([.alignment(.center), .lineSpacing(20)]))) // All line text alignment is center and line space is 20.\n    .apply(with: .paragraph(.firstLineHeadIndent(20)), for: \"world\")  // Containing \"world\", the head indent of line is 20px\n```\n\n# TODO\n- [ ] Write test  \n- [x] Add demo project  \n- [ ] Add playground sample\n- [x] CocoaPods\n- [ ] Carthage\n\n# License \n**StringAttribute** is available under the **MIT** license. See the LICENSE file for more info.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbannzai%2Fstringattribute","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbannzai%2Fstringattribute","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbannzai%2Fstringattribute/lists"}