Closed Dan2552 closed 6 years ago
Hello, could you link to a sample project with the two different behaviours? Thanks
Thanks for your time.
Here's a sample project: https://www.dropbox.com/s/dj4y5s47f62n9m9/MarklightExample.zip?dl=1
Hello, the order is important, I've changed the sample project you provided with this code (taken from the provided Marklight Sample project) and the grow seems to work perfectly.
private func insert(_ text: String) {
let layoutManager = NSLayoutManager()
let textStorage = MarklightTextStorage()
// Assign the `UITextView`'s `NSLayoutManager` to the `NSTextStorage` subclass
textStorage.addLayoutManager(layoutManager)
let textContainer = NSTextContainer()
layoutManager.addTextContainer(textContainer)
let view = UITextView(frame: CGRect(x: 0, y: 0, width: 100, height: 20), textContainer: textContainer)
// let view = UITextView()
view.isScrollEnabled = false
let last = scrollView.subviews.last!
scrollView.addSubview(view)
view.autoPinEdge(.top, to: .bottom, of: last, withOffset: 8)
view.autoPinEdge(toSuperviewEdge: .left, withInset: 8)
view.autoPinEdge(toSuperviewEdge: .right, withInset: 8)
}
I'm closing the issue as it seems that it was caused by a wrong client-side implementation.
Marklight looks great, fantastic work!
When using a plain
UITextView
, as I type the size of the view changes to fit the content/text of the view. When enablingMarklight
, this behaviour seems to stop. Do you know what could be causing this?Only constraints for the view in question are (using
PureLayout
):