szweier / szmentions Goto Github PK
View Code? Open in Web Editor NEWLibrary to help handle mentions
License: MIT License
Library to help handle mentions
License: MIT License
/Users/me/Downloads/SZMentions-master/SZMentionsExample/SZMentionsExample/Classes/SZExampleMention.h:9:9: 'SZMentions/SZMentionsListener.h' file not found
can you give me a suggestion?
thanks
julian
The swift version here is okey but this is wrong in iOS 11. Plz help me check this again. Plz refer image bellow:
According I'm trying to pod swift version to my Objective-C project but cannot run
Hi @szweier , Awesome library you have made. I have integrated it in my code. Working fine. But just one feature I want, that is to remove mention in just one stroke while backspacing. I just tried the following code,
if let mention = mentions |> mentionBeingEdited(at: range) {
mention |> clearMention()
/* let str = mentionsTextView.attributedText.string
let replaceStr = NSAttributedString(string:str.replacingOccurrences(of: mention.object.display, with: ""))
print("NAME ",mention.object.display)
print("RANGE ",range)
let str = mentionsTextView.attributedText.string
let replacedNameString = str.replacingOccurrences(of: mention.object.display, with: "")O
print("NAME AFTER REPLACE ",replacedNameString)
let (text, selectedRange) = mentionsTextView.attributedText
|> replace(charactersIn: NSRange(str.startIndex..., in: str), with: replacedNameString)
print("TEXT ",text.string)
print("selectedRange ",selectedRange)*/
// mentionsTextView.selectedRange = NSRange(mention.object.display.startIndex..., in: mention.object.display)
self.mentionsTextView.text = self.mentionsTextView.text.replacingOccurrences(of: mention.object.display, with: "")
print("self.mentionsTextView.text ",self.mentionsTextView.text)
print("mentionsTextView.attributedText ",mentionsTextView.attributedText)
print("RANGE ",NSRange(self.mentionsTextView.text.startIndex..., in: self.mentionsTextView.text))
print(mentions.count)
let (text, selectedRange) = mentionsTextView.attributedText
|> replace(charactersIn: NSRange(self.mentionsTextView.text.startIndex..., in: self.mentionsTextView.text), with: self.mentionsTextView.text)
/let (text, selectedRange) = mentionsTextView.attributedText
|> replace(charactersIn: range, with: text)/
mentionsTextView.attributedText = text
mentionsTextView.selectedRange = selectedRange
shouldChangeText = false
above code is working fine, when we tried to remove mention from last. But if we tried to remove it from the middle then app crashed.
Example. Suppose I have a note like this,
test @abc and @pqr
1] Now if I start to remove mention @pqr first, then it will remove in one stroke
2] But when I start to remove mention @abc first, then app crashes. Please help if anyone is having the solution for this
when trying @text with new line in textview delegate method "showMentionsListWithString" not being called. can you please help for the same?
Let's say I'm using your example and I type something like "A test with @Steven Zweier library
"
When reading back the textView.text
, it would read back as "A test with Steven Zweier library".
Is there anything implemented to return this String informing what was a mention and what is "plain text", for example, to be able to set differently in Labels later, identifying the mention? Or is this something that should be implemented at a high level?
If so, do you recommend anything specific to be able to identify this?
My project is using Swift but I harder to implement to my project. Possible do an example in swift?
Is there a way to cancel searching and not resign the textView's firstResponder? I want to allow users to cancel searching by tapping a button or the textView.
My mentions listener has spaceAfterMention, addMentionOnReturnKey, and searchSpaces all set to true.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.