We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
func nsRange(from range: Range<String.Index>) -> NSRange { // let from = range.lowerBound.samePosition(in: utf16) // let to = range.upperBound.samePosition(in: utf16) // utf16.distance(from: utf16.startIndex, to: from) //utf16.distance(from: from, to: to) return NSRange.init(range, in: self) // return NSRange(location:self.startIndex ,length: ) }
注释的地方是您的代码。
2、在extension中添加储存属性可以使用runtime
private func setIsTapAction(isTapAction: Bool) { objc_setAssociatedObject(self, &AssociatedKeys.tapAction, isTapAction as Bool, objc_AssociationPolicy.OBJC_ASSOCIATION_RETAIN_NONATOMIC) } private func getIsTapAction() -> Bool { let isTap = objc_getAssociatedObject(self, &AssociatedKeys.tapAction) as? Bool return isTap != nil ? isTap! : true }
如果用原来的实现方式会出现第二地方添加的action会清空上一次的添加的.
The text was updated successfully, but these errors were encountered:
多谢指出
Sorry, something went wrong.
No branches or pull requests
注释的地方是您的代码。
2、在extension中添加储存属性可以使用runtime
如果用原来的实现方式会出现第二地方添加的action会清空上一次的添加的.
The text was updated successfully, but these errors were encountered: