Coder Social home page Coder Social logo

amattributedhighlightlabel's People

Contributors

jessearmand avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

amattributedhighlightlabel's Issues

Please make the regex configurable

Right now the regex works for a very specific rule set which is often not enough for a particular situation (- in hashtags for example, or . in usernames)

NSAttributedString invalid for autoresizing

Got new issue here :
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'NSAttributedString invalid for autoresizing, it must have a single spanning paragraph style (or none) with a non-wrapping lineBreakMode.'

Do you know how to fix this?

New Regular Expression

I'm currently works with AMAttributedHighlightLabel, in some urls like this http://www.youtube.com/watch?v=iFNdGaN0P50 the regular expression has issues with some chars (in this case the question mark).

NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"((@|#)([A-Z0-9a-z(é|ë|ê|è|à|â|ä|á|ù|ü|û|ú|ì|ï|î|í)_]+))|(http(s)?://([A-Z0-9a-z._-]*(/)?)*)" options:NSRegularExpressionCaseInsensitive error:&error];

I've found a new regex for fix this issue:

NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"((@|#)([A-Z0-9a-z(é|ë|ê|è|à|â|ä|á|ù|ü|û|ú|ì|ï|î|í)_]+))|((?i)\\b((?:[a-z][\\w-]+:(?:/{1,3}|[a-z0-9%])|www\\d{0,3}[.]|[a-z0-9.\\-]+[.][a-z]{2,4}/)(?:[^\\s()<>]+|\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\))+(?:\\(([^\\s()<>]+|(\\([^\\s()<>]+\\)))*\\)|[^\\s`!()\\[\\]{};:'\".,<>?«»“”‘’])))" options:NSRegularExpressionCaseInsensitive error:&error];

Hope this helps for someone.

Bad scrolling performance

AMAttributedHighlightLabel has a bad performance when used in a table because the tappable areas get calculated every time the user scrolls. If you don't need tappable links in a table, simply comment out that part.

        for(int i = 0;i < matchRange.length;i++)
        {
            CGRect pos = [self rectForLetterAtIndex:matchRange.location + i];
            [touchableWords addObject:tappableWord];
            [touchableWordsRange addObject:[NSValue valueWithRange:matchRange]];
            [touchableLocations addObject:[NSValue valueWithCGRect:pos]];
        }

not working when text start with www

Its not working when we simply post website name like www.github.com

There is code written for that but ,
NSTextCheckingResult *match = [regex firstMatchInString:word options:0 range:NSMakeRange(0, [word length])];

match will be nil when word start with www so its not going into below condition

if ([tappableWord length] > 0)
        {
}

It will be great if someone can post the solution of it.

Thanks

AMAttributedHighlightLabel and Purelayout

All the resizing works ok, but the clicking of a mention, hashtag or url only works on the first line. I've checked the label background and that is correct the height.

Does AMAttributedHighlightLabel have any known issues with Purelayout?

Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.