Skip to content

Instantly share code, notes, and snippets.

@brandonasuncion
Created March 29, 2019 10:33
Show Gist options
  • Select an option

  • Save brandonasuncion/125dd8571a0343dbd4a5a062bcd2d1cc to your computer and use it in GitHub Desktop.

Select an option

Save brandonasuncion/125dd8571a0343dbd4a5a062bcd2d1cc to your computer and use it in GitHub Desktop.
Using a custom NSLayoutManager
let textStorage = NSTextStorage()
let layoutManager = NSLayoutManager()
let textContainer = NSTextContainer(size: bounds.size)
layoutManager.addTextContainer(textContainer)
textStorage.addLayoutManager(layoutManager)
let textView = UITextView(frame: bounds, textContainer: textContainer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment