title: UITextView's textContainer line break and maximum number of lines not working
body: <p>I have a UITextView in it's own class, and I'm trying to get the maximum number of lines to work so that the text doesn't go beyond the bounds of the UITextView, along with character wrapping to work, as it wants to always be in word wrapping mode. The line height (4.9) is working however.</p>
  
  <p>I'm not sure as to what is causing this to malfunction. I'd appreciate any help offered.</p>
  
  <p>Here is the code I'm using:</p>
  
  <p>CustomTextView.h</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  @interface CustomTextView : UITextView &lt;NSLayoutManagerDelegate&gt;
  
  @end
  </code></pre>
  
  <p>CustomTextView.m</p>
  
  <pre><code>#import "CustomTextView.h"
  
  @implementation CustomTextView
  
  - (id)initWithFrame:(CGRect)frame
  {
      self = [super initWithFrame:frame];
      if (self)
      {
          self.backgroundColor = [UIColor clearColor];
          self.font = [UIFont systemFontOfSize:21.0];
          self.dataDetectorTypes = UIDataDetectorTypeAll;
          self.layoutManager.delegate = self;
          self.tintColor = [UIColor companyBlue];
          [self setLinkTextAttributes:@{NSForegroundColorAttributeName:[UIColor companyBlue]}];
          self.contentInset = UIEdgeInsetsMake(0.5, 0, 0, 0);
          self.scrollEnabled = NO;
          self.textContainer.maximumNumberOfLines = 9;
          self.textContainer.lineBreakMode = NSLineBreakByCharWrapping;
      }
      return self;
  }
  
  - (CGFloat)layoutManager:(NSLayoutManager *)layoutManager lineSpacingAfterGlyphAtIndex:(NSUInteger)glyphIndex withProposedLineFragmentRect:(CGRect)rect
  {
      return 4.9;
  }
  
  @end
  </code></pre>