How do I present a UITableViewController with a blurred background as a form sheet over the current context?
- (void)viewDidLoad {
self.tableView.backgroundColor = [UIColor clearColor];
self.tableView.backgroundView = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]];
}
It works fine full screen, on iPhones set with UIModalPresentationOverCurrentContext
But for iPad if I want to display it as a form sheet then I need to set modalPresentationStyle
to UIModalPresentationFormSheet
.
How do I set both?
I found I needed to use
UIModalPresentationPopover
for themodalPresentationStyle
and then you can set the view controllerspopoverPresentationColor
toclearColor
.