How can I get the selected text frame from a UITextView

I'm trying to display an UIPopoverController from the rect of a selected text in an UITextView, How can I get the selected text CGRect ? Thanks!