title: Textview Center Text Alignment IOS 7
body: <pre><code>-(void)observeValueForKeyPath:(NSString *)keyPath   ofObject:(id)object   change:(NSDictionary *)change   context:(void *)context 
  {
      NSLog(@"Hello");
      UITextView *tv = object;
      CGFloat topCorrect = ([tv bounds].size.height - [tv contentSize].height * [tv zoomScale])  / 2.0;
      topCorrect = ( topCorrect &lt; 0.0 ? 0.0 : topCorrect );
      tv.contentOffset = (CGPoint){.x = 0, .y = -topCorrect};
  }
  </code></pre>
  
  <p>I am calling it like this in Viewdidload</p>
  
  <pre><code>[myTextView1 addObserver:self forKeyPath:@"contentSize" options:(NSKeyValueObservingOptionNew) context:NULL];
  </code></pre>