I began to debug the hierarchy MFMailComposeViewController. Here is my code.
MFMailComposeViewController *mailComposeViewController = [[MFMailComposeViewController alloc] init];
[self presentViewController:mailComposeViewController animated:YES completion:^{
UIViewController* mailViewController = [mailComposeViewController.topViewController.childViewControllers firstObject];
UIView *mailView = [mailViewController.view.subviews firstObject];
CALayer *mailLayer = mailView.layer;
mailLayer.opacity = 0.5f;
UIView *backgroundView = [[UIView alloc] initWithFrame:mailView.bounds];
backgroundView.backgroundColor = [UIColor redColor];
[mailViewController.view insertSubview:backgroundView atIndex:0];
}];
I found that MFMailComposeViewControllerbeing a kind of UINavigationControllerhas a top view controller that has a child view controller. In the view of the child view controller, there is a subview. This view contains content.
, . , . . alpha , , .
, mailLayer, CALayerHost, ; - . , , .
, , . .