You will have to add the autolayout constraints in the code if you are adding the superview to some other view.
+ (instancetype)presentInViewController:(UIViewController *)viewController withDefaultsKey:(NSString *)defaultsKey {
ELHintViewOwner *owner = [ELHintViewOwner new];
NSArray *bundle = [[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:owner options:nil];
//hintViewOwner.decoupledView.delegateViewController = viewController
ELHintView *hintView = [bundle firstObject];
hintView.frame = viewController.view.bounds;
hintView.titleLabel.text = @"";
hintView.defaultsKey = defaultsKey;
hintView.tapAnywhereLabel.text = NSLocalizedString(@"Tap anywhere to continue", nil);
hintView.showLabel.text = NSLocalizedString(@"Don't show this message again", nil);
hintView.imageView.hidden = YES;
hintView.showSwitch.on = ![[[NSUserDefaults standardUserDefaults] valueForKey:defaultsKey] boolValue];
if ([hintView shouldShow]){
[viewController.view addSubview:owner.decoupledView];
hintView.translatesAutoresizingMaskIntoConstraints = NO;
NSArray *constraintsX = [NSLayoutConstraint constraintsWithVisualFormat:@"H:|[hintView]|" options:0 metrics:nil views:NSDictionaryOfVariableBindings(hintView)];
NSArray *constraintsY = [NSLayoutConstraint constraintsWithVisualFormat:@"V:|[hintView]|" options:0 metrics:nil views:NSDictionaryOfVariableBindings(hintView)];
[viewController.view addConstraints:constraintsX];
[viewController.view addConstraints:constraintsY];
}
return hintView;
}