This repository was archived by the owner on Feb 2, 2023. It is now read-only.
Commit f2012df
committed
Fix Out of bounds error
Actually it is possible that truncated string is longer then original
string.
For example, original string:
```
hello
this is
very long
message here
and there
```
with maximumNumberOfLines=4, truncationAttributedString = ' ...' and
additionalTruncationMessage = 'read more'
will give
```
hello
this is
very long
message here ... read more
```
So `[attributedString attribute:attributeName atIndex:characterIndex
longestEffectiveRange:&range inRange:visibleRange]` will crash.1 parent e0e019e commit f2012df
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
479 | 479 | | |
480 | 480 | | |
481 | 481 | | |
| 482 | + | |
482 | 483 | | |
483 | 484 | | |
484 | 485 | | |
| |||
519 | 520 | | |
520 | 521 | | |
521 | 522 | | |
522 | | - | |
| 523 | + | |
523 | 524 | | |
524 | 525 | | |
525 | 526 | | |
| |||
0 commit comments