[TIMOB-24086] iOS: Label doesn't fire link event correctly
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-11-07T14:59:46.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 6.1.0 |
Components | iOS |
Labels | clickevent, communication, fireevent, ios, label, notable |
Reporter | Flavio De Stefano |
Assignee | Hans Knöchel |
Created | 2016-10-31T10:58:31.000+0000 |
Updated | 2016-11-17T17:12:37.000+0000 |
Description
Sometimes, don't know why, the Labels doesn't fire the link event.
I indagated in the code, and I found that the method to get the link is by finding the index from the clicked point in the Label.
The problem is that the index, is, sometimes, wrong.
I just re-implemented a more elegant version of the "find index", taken from here: https://github.com/AliSoftware/OHAttributedStringAdditions/blob/master/Source/UILabel%2BOHAdditions.m
This is the demo of example that doesn't works and the one that works.
ZIP + MOV.
[tibugt.mov.zip](https://github.com/appcelerator/titanium_mobile/files/561573/tibugt.mov.zip)
PR: https://github.com/appcelerator/titanium_mobile/pull/8568
Test-Case:
Verified fixed, using: MacOS 10.12 (16A323) Studio 4.8.0.201611121409 Ti SDK 6.1.0.v20161117072812 Appc NPM 4.2.9-1 Appc CLI 6.1.0-13 Alloy 1.9.4 Xcode 8.1 (8B62) Link events are correctly fired for labels. Tested by using the provided sample code as well as adding many different attributes to the attributed string for the label and ensuring all link events were fired.