UIModalTransitionStylePartialCurl doesn't get back to previous state. (Not dismissing)

久未见 提交于 2019-11-26 21:07:19

Here is the link to Apple site for the Modal View Controllers

Basically, you need to setup delegate, etc. And call dismissModalViewControllerAnimated: method from your viewcontroller A. Let me know if you need further help.

Edit per MiiChiel:

In BController.h file, add this:

@protocol BControllerDelegate <NSObject>
-(void)dismissMe;
@end

@interface BController : UIViewController
//...
@property (assign) id <BControllerDelegate> delegate;
//...
@end

In BController.m file, add this:

@implementation BController
@synthesize delegate;
//...
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
    [self.delegate dismissMe];
}

In the AController.h file, add this:

#import "BController.h"

@interface AController : UIViewController  <BControllerDelegate>

In the AController.m file, add this:

//add this line before presenting the modal view controller B
bController.delegate = self;  // assuming bController is the name of the modal

-(void)dismissMe
{
    //call back from modal view to dismiss it
    [self dismissModalViewControllerAnimated:YES];
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!