I'm using a swift framework and I need to be able to have a # like tag inside of a message text string. If a user sends a message containing a code prefixed with a #, for example: #t3Us9K that single "word" needs to be a link that all users can press. please tell me if this is possible and if so how to do it.
相关问题
- how to split a list into a given number of sub-lis
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
相关文章
- 现在使用swift开发ios应用好还是swift?
- JSP String formatting Truncate
- UITableView dragging distance with UIRefreshContro
- Using if let syntax in switch statement
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Selecting only the first few characters in a strin
- Enum with associated value conforming to CaseItera
I had been working on your question and this are my results,
First of all you need to modify
JSQMessagesCellTextView
in the library and add a method to help you to detect custom links, like #test, If you want you can clone my fork with this feature added and this is how it looks, the animation issue is because my gif converterEDITED
https://github.com/rmelian2014/JSQMessagesViewController/tree/contributing
I had added a delegate to provide regular expressions to check with
and then you need to put your viewController as UITextViewDelegate and finally in your cellForRowAtIndexPath you need to put something like this
this will put your viewController as regularExpressionsDelegate and then you need to implement this method, returning the regular expressions that you want be detected as customs links
also you need to implement this
I Hope this helps you, Regards