UIPopoverBackgroundView without rounded corners

ios, objective-c, uipopoverbackgroundview, uipopovercontroller

Solution

I found an easy solution, in the popover content controller (what you pass to `initWithContentViewController`) add:

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    self.view.superview.layer.cornerRadius = 0;
}

Problem

I am making a custom popover background by subclassing UIPopoverBackgroundView. I want to make popover without rounded corners. I can successfully create background without rounded corners (red in picture), but it seems that UIPopoverController adds some rounded corner mask to the content of the popover (green in picture). Here is the picture of the corner of my popover: Any ideas how I can overcome it?

Original source