如何用动画呈现Xib

How to present Xib with animation

我有一个自定义视图 (xib),我在单击按钮时显示此 xib。 xib 没有任何 issue.But 呈现,我无法用一些动画来呈现它。 这是我尝试过的:

// Instantiate the nib content without any reference to it.
NSArray *nibContents = [[NSBundle mainBundle] loadNibNamed:@"CustomView" owner:nil options:nil];

// Find the view among nib contents (not too hard assuming there is only one view in it).
UIView *plainView = [nibContents lastObject];

// Some hardcoded layout.
CGSize padding = (CGSize){ 12.0, 20.0 };
plainView.frame = (CGRect){padding.width, padding.height, plainView.frame.size};


// Add to the view hierarchy 
[self.tableView addSubview:plainView];

    [UIView animateWithDuration:0.5
                     animations:
     ^{
         plainView.transform = CGAffineTransformMakeScale(1.0f, 1.0f);

     }
     ];

谁能告诉我如何用动画呈现xib?

plainView.transform = CGAffineTransformMakeScale(0.01f, 0.01f);
    // Add to the view hierarchy
    [self.tableView addSubview:plainView];

    [UIView animateWithDuration:0.5
                     animations:
     ^{
         plainView.transform = CGAffineTransformMakeScale(1.0f, 1.0f);

     }
     ];