我已经解决了这个问题。在这里写下解决方案,以防有人遇到同样的问题。
主VC.h:
#import <UIKit/UIKit.h>
#import "OXDcurlViewController.h"
@interface OXDmainViewController : UIViewController <OXDcurlViewControllerDelegate>
@property (strong, nonatomic) IBOutlet UIButton *curlButton;
- (IBAction)curlReveal:(id)sender;
@end
主VC.m:
#import "OXDmainViewController.h"
#import "OXDcurlViewController.h"
#import "OXDsecondViewController.h"
@interface OXDmainViewController ()
@end
@implementation OXDmainViewController
- (void)viewDidLoad
{
[super viewDidLoad];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction)curlReveal:(id)sender {
OXDcurlViewController *curlVC = [[OXDcurlViewController alloc]initWithNibName:@"OXDcurlViewController" bundle:nil];
curlVC.modalTransitionStyle = UIModalTransitionStylePartialCurl;
curlVC.delegate = self;
[self presentViewController:curlVC animated:YES completion:^{}];
}
-(void)presentSecondVC{
OXDsecondViewController *secondVC = [[OXDsecondViewController alloc]initWithNibName:@"OXDsecondViewController" bundle:nil];
secondVC.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentViewController:secondVC animated:YES completion:^{}];
}
@end
curlVC.h:
#import <UIKit/UIKit.h>
@protocol OXDcurlViewControllerDelegate <NSObject>
@optional
-(void)presentSecondVC;
@end
@interface OXDcurlViewController : UIViewController
@property (strong, nonatomic) IBOutlet UIButton *actionButton;
@property (nonatomic, weak) id<OXDcurlViewControllerDelegate> delegate;
- (IBAction)actionReveal:(id)sender;
@end
curlVC.m:
#import "OXDcurlViewController.h"
#import "OXDsecondViewController.h"
@interface OXDcurlViewController ()
@end
@implementation OXDcurlViewController
@synthesize delegate;
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction)actionReveal:(id)sender {
[self dismissViewControllerAnimated:YES completion:^{
[self.delegate presentSecondVC];
}];
}
@end
感谢所有帮助过我的人。
大卫阿尔瓦雷斯麦地那