Closed Sea-Eagle closed 6 years ago
If you use storyboard for this view controller, you should override initWithCoder and set the contentSize instead.
You need to set self.contentSizeInPopup = CGSizeMake(300, 400); in the view will appear of the view that you are using as your bottom screen
`// // ProfileViewController.h
import <UIKit/UIKit.h>
import
import <SDWebImage/UIImageView+WebCache.h>
import <STPopup/STPopup.h>
@interface ProfileViewController : UIViewController
@end
import "ProfileViewController.h"
@interface ProfileViewController ()
@end
@implementation ProfileViewController
}
-(void)updateUserContactDetails:(NSString )path Params:(NSDictionary )params{
}
pragma mark - STPopupControllerTransitioning
(NSTimeInterval)popupControllerTransitionDuration:(STPopupControllerTransitioningContext *)context { return context.action == STPopupControllerTransitioningActionPresent ? 0.5 : 0.35; }
(void)popupControllerAnimateTransition:(STPopupControllerTransitioningContext )context completion:(void (^)())completion { UIView containerView = context.containerView; if (context.action == STPopupControllerTransitioningActionPresent) { containerView.transform = CGAffineTransformMakeTranslation(containerView.superview.bounds.size.width - containerView.frame.origin.x, 0);
} else { [UIView animateWithDuration:[self popupControllerTransitionDuration:context] delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{ containerView.transform = CGAffineTransformMakeTranslation(- 2 * (containerView.superview.bounds.size.width - containerView.frame.origin.x), 0); } completion:^(BOOL finished) { containerView.transform = CGAffineTransformIdentity; completion(); }]; } }
@end
import <UIKit/UIKit.h>
import <STPopup/STPopup.h>
@interface MobileUpdateOTPViewController : UIViewController
@end
import "MobileUpdateOTPViewController.h"
@interface MobileUpdateOTPViewController ()
@end
@implementation MobileUpdateOTPViewController
(instancetype)init { if (self = [super init]) { self.title = @"Verification Code"; self.contentSizeInPopup = CGSizeMake(300, 400); self.landscapeContentSizeInPopup = CGSizeMake(400, 200); } return self; }
(void)viewDidLoad { [super viewDidLoad]; }
(void)viewDidLayoutSubviews { [super viewDidLayoutSubviews]; }
@end `
I'm getting error
[STPopupController contentSizeOfTopView], ~/Pods/STPopup/STPopup/STPopupController.m:536 2017-06-07 17:40:48.249014+0530: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'contentSizeInPopup should not be size zero.'