-
Notifications
You must be signed in to change notification settings - Fork 344
Revisions History
This page lists the major changes that appeared across the various OHAttributedLabel versions / git tags.
You can see and download any tagged version of OHAttributedLabel here (or simply specify a specific version in your Podfile if you use CocoaPods).
- Versions 3.x.x : 3.5.x - 3.4.x - 3.3.x - 3.2.x - 3.1.x - 3.0.x
- Versions 2.x.x : 2.2.x - 2.1.x - 2.0.x
- Versions 1.x.x : 1.3.x - 1.2.x - 1.1.x - 1.0.x
- Versions 0.x.x
- Definitely dropping ARC support
(This is mainly to avoid leak cases with non-ARC — like the one fixed in 3.5.1 — as I don't test non-ARC anymore and to ease future maintainability)
- Fixing a leak in UITouchGestureRecognizers when not using ARC (see #161)
- Fixing an issue with text highlight (see #162)
Thanks to @mattjgalloway for all these great Pull Requests lately 👍
- Optimisations on constructor (
canOpenURL:) - Add support for character spacing in
NSAttributedString+Attributes.h(#127) - Fix bug with links (when label only contained custom links, etc) (#135, #136)
- Fixed
OHASBasicMarkupParserdetection RegExes (#150) - Now also supports building fat static library (in addition to CocoaPods or manual integration in the workspace) (#132)
- Migrated to gesture recognizers instead of touch events (#134)
- Fixed a crash in iOS5 introduced by
3.4.2
- Fixed warnings for Xcode 5
- Links can now optionally be activated on
touchBeganinstead oftouchEnded - Tested on Xcode 4.6 and iOS 6.1, and fixed some new warnings about implicit conversions
- Improved the hack for the private iOS font
.HelveticaNeueUIvariants
Note that the hack for the
.HelveticaNeueUIfont family was introduced to fix an Apple bug on this font (which failed to find its bold and italic variants on prior versions of iOS) but this Apple bug seems to have been fixed on iOS 6.1, so the hack is now only useful for users still running iOS versions prior to iOS 6.1
- Added "setTextItalics:" method
- Added support for italics in Markup Parsers (
|some text|forOHASBasicMarkupParser,<i>some text</i>forOHASHTMLMarkupParser) - Changed the integration process to a more elegant and clean solution, easier to integrate in your application. Now use again
#import <OHAttributedLabel/OHAttributedLabel.h>… but no need at all to add the relative path to "Header Search Path" anymore!
- Added
OHParagraphStyleclass that allows you to easily change a whole new set of styles on yourNSAttributedStrings. This includes the possibility to control: - The line height (#41) of your paragraphs,
- The spacing between paragraphs,
- Line indentation (#109) of your paragraphs (first line indent, other lines head and tail indent…)
- And you can also change the text alignment and line breaking mode using this new API instead of the old
setTextAlignment:lineBreakMode:range:method. - Fixed the
setTextAlignment:lineBreakMode:range:method to use the new API internally. This fixes the issue with the previous code which did override any other existing paragraph styles if any (like line height, indentation, etc). - Added
beginEditing/endEditingcalls to methods that generate multiple attributes changes at once (setTextBold,modifyParagraphStylesWithBlock:). This should avoid useless consolidation and KVO notifications during the change. - Fixed small issues in code consistency (#107, #108)
- Updated Demo project to demonstrate these new features
- Minor fixes concerning vertically centering
- Added LICENSE header in files where it was missing
- Fixed leak on
CTFontCreatewhen in ARC - Added
#warningsfor users who didn't integrate the library the right way (and messed with the library build settings). This is to avoid complaints afterwards from users that have issues just because they didn't even follow the README instructions to integrate the library to their project.
-
OHASMarkupParsersnow allows markup tags to enclose text containing line separators (text on multiple lines)
- Even if
OHAttributedLabelis designed to be compiled in its own workspace with its own compilation settings, namely without ARC, this commit fixes cases when you try to compile it using ARC anyway.
-
UIColorFromStringrenamed toOHUIColorFromStringto avoid naming collision (for example with MagicalRecord that uses a function with the same name)
-
NSAttributedString+Attributesnow haslinkAtIndex:effectiveRange:andsetLink:range:methods to add links to aNSAttributedStringdirectly.
This method use an attribute namedkOHLinkAttributeNameto add to the attributed string. (This constant is equal to the value@"NSLinkAttribute"which is the value used in OSX, so that if this attribute is ported to iOS in a future iOS version, it will probably work with it too) -
OHASBasicHTMLParsernow support<a href="someURL">some text</a>tags to add links -
OHASBasicMarkupParsernow support[some text](someURL)markup to add links
Note that now that it is possible to add links directly to NSAttributedStrings, it is the preferred way to add links to a text (instead of calling addCustomLink:inRange: on the OHAttributedLabel), so that the link is attached to the string and not the label that displays it.
- Removed "Installation" phase from compilation (Skip Install = YES) to avoid mess like in #90.
Now we are back to straight quoted-style imports#import "OHAttributedLabel.h"(instead of square braquets) but users must add the path to the OHAttributedLabel headers to their project's"User Header Search Paths" - Added some
@autoreleasepoolto reduce memory footprint, some code reformatting - Fixes #55 and #99
And improved TableView example to show how to manage variable cell heights depending on NSAttributedString size.
- Now you can bitwise-OR the
linkUnderlineStyle(the property as well as the one used in the delegate method) withkOHBoldStyleTraitSetBoldorkOHBoldStyleTraitUnSetBoldto change the font weight used for links.
- Fixed crash in
OHASMarkupParserswhen empty match (when no text between opening and closing markup) - Fixed library Deployment Target (#93)
- Renamed
OHASTagParser*classes toOHAS*Parsernames invoking markup and not tags (as it is more flexible that just HTML tags).
- Added
OHASTagParserclasses to build NSAttributedString using simple HTML (<b>,<u>,<font name=… size=…>,<font color=…>) or simple markup tags ("*bold*", "_underline_", "{red|red text}"…) - Improved memory usage for link detection by recycling
NSDataDetectorinstances. This also improves stability (as the DataDetectorCore library does not like to be stressed) - This also fix an issue where
textIsUnderlinedAtIndex:effectiveRange:returned the opposite value of the one expected.
- Removed iOS6 warnings.
- Modified the project to create a separate library
libOHAttributedLabel.a, to facilitate integration using an Xcode 4 workspace (see example and README
- Adds
UIAppearancesupport for iOS5, to let you easily customize the link color and style of all of yourOHAttributedLabelinstances for your whole app, to fit your application design. - Optimize the calls to
recomputeLinksInText, to prevent the computation to be done multiple times (i.e. each time we change one of the properties) per RunLoop and enforce it to be done only once per RunLoop iteration. (Meaning it now uses the pattern similar to thesetNeedsDisplaymethods, only setting a flag to trigger the computation only once when needed).
This last optimization should reduce the time used especially when you change multiple properties in a row.
- Changed the name of the delegate method from
colorForLink:underlineStyle:toattributedLabel:colorForLink:underlineStyle:.
This is the only change since 1.3.1 but it had to be done to better fit the naming conventions, and is needed if you want to return the default link color and underline style from your delegate methods depending on some conditions.
Besides, as it changes the delegate API, and this version as been retested for various bugs and considered stable enough, it was time to increase to the next major version.
If you update from a previous version, be sure to update your code to change the method signature in your delegate implementation to the new one! (As the previous delegate method signature will stop being called in this new version, the new one being used instead)
- Optimizations for links computation, by avoiding to allocate an
NSDataDetectorat each computation of the links (but allocating it once, whenautomaticallyAddLinksForTypeschanges).
This trick may be simple but increase performance a lot compared to 1.3.0 especially when OHAttributedLabel is used in a UITableViewCell, as links are recomputed each time a cell is reused and its attributedText property is set to a new value.
- Various drawing optimizations, especially by now keeping the
NSAttributedStringwith detected links in cache instead of recomputing the automatically detected links each time (at each redraw). - Fix regressions introduced in 1.2.0 (especially on
highlightedLinkColorand some text color issues) - Adds the
NSTextCheckingResultaddition to retrieve preformattedNSURLfor Google or Apple Maps app.
- ARC support
- The class has been tested with the iOS6 Beta SDK
- Depreciation of fake constant
UITextAlignmentJustifybecause it now throws an exception in iOS6. UsesetTextAlignment:lineBreakMode:on yourNSAttributedStringinstead now. - Added warnings for known issues (for properties not supported by CoreText)
- Accessibility label now updated when text is updated
- some performance (
customLinksallocation deferred,attributedTextWithLinksnot copied anymore -- note that this introduced a regression that was fixed in 1.3.0 -- andrespondsToSelector:check cached)
- Fixed #56 : Accessibility label not being updated when attributed text is set
- Fixed #52 : Fixes issue where brief touches on a link are ignored
- Fixed Apple leak (adding an attribute on an
NSAttributedStringdoes not release the previous affected attribute) and removed some warnings about undeclared private methods.
- Generalized automatic link detection to any
NSTextCheckingTypeallowing links of any kind to be detected automatically. - Added
setTextIsBold:range:method to change the font variant easily, even acrossCTRunsthat use different fonts. - Tried to add subscript/superscript support in
NSAttributedString+Attributes, but aborted since quite no CoreText font support it in practice.
- Optimized CTFrame computation, fixed leaks, fixed link touch detection when
centerVertically=YESand various other bug fixes. - Also fixed Clang-LLVM and Xcode4 warnings (version before 0.0.4 was developed with GCC & Xcode3)
- First version considered stable and trustworthy for production
- Bug fixes & merge of various pull requests.
- Especially adding link color and underline style properties, fixed sizeThatFits and various links touches detection, and added
initWithFrame:(before 0.0.3 onlyinitWithCoder:was implemented)
- Added links autodetection
- First and basic pre-release version