kevin-lyn / STPopupPreview

An alternative peek preview for non 3D Touch devices. Inspired by Instagram.
MIT License
202 stars 30 forks source link

The error 'contentSizeInPopup should not be size zero' #6

Closed Sea-Eagle closed 6 years ago

Sea-Eagle commented 7 years ago

`// // 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{

    STPopupController *popupController = [[STPopupController alloc] initWithRootViewController:[[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"MobileUpdateOTP"]];
    popupController.style = STPopupStyleBottomSheet;
    [popupController presentInViewController:self];

}

pragma mark - STPopupControllerTransitioning

@end

import <UIKit/UIKit.h>

import <STPopup/STPopup.h>

@interface MobileUpdateOTPViewController : UIViewController

@end

import "MobileUpdateOTPViewController.h"

@interface MobileUpdateOTPViewController ()

@end

@implementation MobileUpdateOTPViewController

@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.'

kevin-lyn commented 6 years ago

If you use storyboard for this view controller, you should override initWithCoder and set the contentSize instead.

yashjariwala commented 1 year ago

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