-
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
OHASBasicMarkupParser
detection 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
touchBegan
instead 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
.HelveticaNeueUI
variants
Note that the hack for the
.HelveticaNeueUI
font 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
OHParagraphStyle
class 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
/endEditing
calls 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
CTFontCreate
when in ARC - Added
#warnings
for 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.
-
OHASMarkupParsers
now allows markup tags to enclose text containing line separators (text on multiple lines)
- Even if
OHAttributedLabel
is 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.
-
UIColorFromString
renamed toOHUIColorFromString
to avoid naming collision (for example with MagicalRecord that uses a function with the same name)
-
NSAttributedString+Attributes
now haslinkAtIndex:effectiveRange:
andsetLink:range:
methods to add links to aNSAttributedString
directly.
This method use an attribute namedkOHLinkAttributeName
to 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) -
OHASBasicHTMLParser
now support<a href="someURL">some text</a>
tags to add links -
OHASBasicMarkupParser
now 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
@autoreleasepool
to 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) withkOHBoldStyleTraitSetBold
orkOHBoldStyleTraitUnSetBold
to change the font weight used for links.
- Fixed crash in
OHASMarkupParsers
when empty match (when no text between opening and closing markup) - Fixed library Deployment Target (#93)
- Renamed
OHASTagParser*
classes toOHAS*Parser
names invoking markup and not tags (as it is more flexible that just HTML tags).
- Added
OHASTagParser
classes 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
NSDataDetector
instances. 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
UIAppearance
support for iOS5, to let you easily customize the link color and style of all of yourOHAttributedLabel
instances 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 thesetNeedsDisplay
methods, 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
NSDataDetector
at each computation of the links (but allocating it once, whenautomaticallyAddLinksForTypes
changes).
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
NSAttributedString
with 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
highlightedLinkColor
and some text color issues) - Adds the
NSTextCheckingResult
addition to retrieve preformattedNSURL
for Google or Apple Maps app.
- ARC support
- The class has been tested with the iOS6 Beta SDK
- Depreciation of fake constant
UITextAlignmentJustify
because it now throws an exception in iOS6. UsesetTextAlignment:lineBreakMode:
on yourNSAttributedString
instead now. - Added warnings for known issues (for properties not supported by CoreText)
- Accessibility label now updated when text is updated
- some performance (
customLinks
allocation deferred,attributedTextWithLinks
not 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
NSAttributedString
does not release the previous affected attribute) and removed some warnings about undeclared private methods.
- Generalized automatic link detection to any
NSTextCheckingType
allowing links of any kind to be detected automatically. - Added
setTextIsBold:range:
method to change the font variant easily, even acrossCTRuns
that 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=YES
and 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