{"id":16886673,"url":"https://github.com/alisoftware/ohattributedstringadditions","last_synced_at":"2025-08-19T22:08:32.790Z","repository":{"id":56921151,"uuid":"22935531","full_name":"AliSoftware/OHAttributedStringAdditions","owner":"AliSoftware","description":"NSAttributedString Additions that add convenience methods to manipulate attributed strings easily","archived":false,"fork":false,"pushed_at":"2016-05-13T14:55:20.000Z","size":2979,"stargazers_count":107,"open_issues_count":2,"forks_count":17,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-01-11T21:22:30.357Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","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/AliSoftware.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":"2014-08-14T00:14:17.000Z","updated_at":"2024-05-05T01:34:28.000Z","dependencies_parsed_at":"2022-08-21T04:50:41.128Z","dependency_job_id":null,"html_url":"https://github.com/AliSoftware/OHAttributedStringAdditions","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliSoftware%2FOHAttributedStringAdditions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliSoftware%2FOHAttributedStringAdditions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliSoftware%2FOHAttributedStringAdditions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliSoftware%2FOHAttributedStringAdditions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AliSoftware","download_url":"https://codeload.github.com/AliSoftware/OHAttributedStringAdditions/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233753246,"owners_count":18724821,"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-10-13T16:40:40.303Z","updated_at":"2025-01-13T14:05:50.449Z","avatar_url":"https://github.com/AliSoftware.png","language":"Objective-C","readme":"# OHAttributedStringAdditions\n\n[![Version](http://cocoapod-badges.herokuapp.com/v/OHAttributedStringAdditions/badge.png)](http://cocoadocs.org/docsets/OHAttributedStringAdditions)\n[![Platform](http://cocoapod-badges.herokuapp.com/p/OHAttributedStringAdditions/badge.png)](http://cocoadocs.org/docsets/OHAttributedStringAdditions)\n[![Build Status](https://travis-ci.org/AliSoftware/OHAttributedStringAdditions.png?branch=master)](https://travis-ci.org/AliSoftware/OHAttributedStringAdditions)\n\nThis pod contains categories on `NSAttributedString` to add a lot of very useful convenience methods to manipulate attributed strings.\n\nConvenience methods include:\n\n* **font** manipulation (`setFont:range:` and `fontAtIndex:effectiveRange:`)\n* **text color** (`setTextColor:range:` and `textColorAtIndex:effectiveRange:`)\n* **background color**\n* **bold**, *italics* and *underline* styles\n* add **URLs** to your text\n* **paragraph styles** (**indentation**, **line spacing**, …)\n* baseline adjustment, **subscript**, **superscript**, …\n* And much more\n\nIt also contains:\n\n* A category on `UIFont` to build a font given its postscript name and derive a bold/italic font from a standard one and vice-versa.\n* A category on `UILabel` to make it easier to detect the character at a given coordinate, which is useful to detect if the user tapped on a link (if the character as a given tapped `CGPoint` has an associated `NSURL`) and similar stuff\n\n\u003e Note that for advanced URL detection, you should still prefer `UITextView` (configuring it with `editable=NO`) and its dedicated delegate methods instead of using `UILabel` (which does not publicly expose its `NSLayoutManager` to properly compute the exact way its characters are laid out, forcing us to recreate the TextKit objects ourselves, contrary to `UITextView`).\n\n## Documentation\n\nThe source code is fully commented and documentation is auto-generated [here](http://cocoadocs.org/docsets/OHAttributedStringAdditions).\n\nThere is also some help pages [in the repository's wiki](https://github.com/AliSoftware/OHAttributedStringAdditions/wiki).\n\n## Installation\n\nThe suggested installation is via [CocoaPods](http://cocoapods.org/). Simply add the following line to your `Podfile`:\n\n```\npod 'OHAttributedStringAdditions'\n```\n\nThen do a `pod install`.\n\n## Example\n\nA demo project is provided in the repository. Don't hesitate to open `Example/AttributedStringDemo.xcworkspace` and play with it.\n\nIf you have CocoaPods, you can even try that Sample project even if you don't have cloned the project yet, by using `pod try OHAttributedStringAdditions` in your terminal.\n\n![Demo Capture](README.png)\n\n## Future improvements\n\n* Improving **documentation on edge cases**, like documenting the behavior about when some attribute is not present or if we are allowed to pass nil to arguments.\n* Adding **support for OSX**. This should only need little adjustments, like getting rid of the `#import \u003cUIKit/UIKit.h\u003e` in the pch file, or replacing `UIColor` and `UIFont` classes with `NSColor` and `NSFont` (using macros to switch from one to another depending on the SDK), but that still requires some work and tests.\n\n\u003e _Note: The original code of these categories comes from my old `OHAttributedLabel` pod, which is now deprecated as I don't have time to maintain it. As this previous implementation was based on CoreText and was not compatible (sometimes even crash) with UIKit/TextKit, I converted those categories to create this UIKit-compliant `NSAttributedString`, not related to CoreText and `OHAttributedLabel` anymore and that now work with latest versions of iOS/UIKit/TextKit._\n\n## Licence\n\nThis component is under the MIT Licence (See the `LICENSE` file).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falisoftware%2Fohattributedstringadditions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falisoftware%2Fohattributedstringadditions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falisoftware%2Fohattributedstringadditions/lists"}