Post

Replies

Boosts

Views

Activity

Reply to App crashes with error "Fatal Exception: NSInvalidArgumentException -[<NSTextContentStorage: 0x281dc68a0> locationFromLocation:withOffset:] received invalid location (null)"
If you are using UITextView inside cell and want to achieve dynamic resizing toggle is isScrollEnabled on didEndEditing and didBeginEditing. . . . f.e. textView.rx .didBeginEditing .asDriverIgnoringErrors() .drive(onNext: { [unowned self] in if textView.text == placeholder { textView.text = "" textView.textColor = textColor textView.isScrollEnabled = false } }) textView.rx .didEndEditing .asDriverIgnoringErrors() .drive(onNext: { [unowned self] in if textView.text.isEmpty { textView.text = placeholder textView.textColor = placeholderColor textView.isScrollEnabled = true } }) .disposed(by: disposeBag)
Jan ’23