title: How would you center a UITextView as a subview of a UIView?
body: <p>I have a UITextView that is inside a UIView. I managed to center a UITextView using the following code:</p>
  
  <pre><code>self.textView.textAlignment = NSTextAlignmentCenter;
  </code></pre>
  
  <p>Right now, the text is center within the UITextView, but I would also like to center the UITextView within a UIView.</p>
  
  <p>How can I achieve this?</p>
  
  <p>I have tried the following code, but it seems to do nothing.</p>
  
  <pre><code>[self.textView setCenter:CGPointMake(self.topView.frame.size.width/2 - self.textView.frame.size.width/2, self.topView.frame.size.height/2)];
  </code></pre>
  
  <p>Thanks</p>