:self];
    [parent.view addSubview:view];
    [self didMoveToParentViewController:parent];

    NSArray *horizontalConstraints = [NSLayoutConstraint constraintsWithVisualFormat:@"H:|-0-[view]-0-|"
                                                                             options:0
                                                                             metrics:nil
                                                                               views:NSDictionaryOfVariableBindings(view)];
    [parent.view addConstraints:horizontalConstraints];

    NSArray *verticalConstraints = [NSLayoutConstraint constraintsWithVisualFormat:@"V:|-0-[view]-0-|"
                                                                           options:0
                                                                           metrics:nil
                                                                             views:NSDictionaryOfVariableBindings(view)];
    [parent.view addConstraints:verticalConstraints];
}

then inside the parent UIViewController (the one which is already displayed), when I want to display my child popup view controller it calls:
PopUpNotificationViewController *popup = [[self storyboard] instantiateViewControllerWithIdentifier:@"NotificationPopup"];
[popup addPopupToController:self];

You can define whatever constraints you want on the child controller's view when adding it to the parent controller's view.

A:

You can add constraints right after invoke of addSubview:, don't forget to set translatesAutoresizingMaskIntoConstraints to false
Here is a code snippet of adding and hiding child view controller with constraints (inspired by apple guide)
Display
private func display(contentController content : UIViewController)
    {
        self.addChildViewController(content)
        content.view.translatesAutoresizingMaskIntoConstraints = false
        self.containerView.addSubview(content.view)
        content.didMove(toParentViewController: self)

        containerView.addConstraints([
            NSLayoutConstraint(item: content.view, attribute:.top, relatedBy:.equal, toItem: containerView, attribute:.top, multiplier: 1, constant: 0),
            NSLayoutConstraint(item: content.view, attribute:.bottom, relatedBy:.equal, toItem: containerView, attribute:.bottom, multiplier: 1, constant: 0),
            NSLayoutConstraint(item: content.view, attribute:.leading, relatedBy:.equal, toItem: containerView, attribute:.
: self ]; 
     [ parent.view addSubview: view ]; 
     [ self didMoveToParentViewController: parent ]; 

     NSArray * horizontalConstraints = [ NSLayoutConstraint constraintsWithVisualFormat:@"H:|-0-[view]-0-| " 
                                                                              options:0 
                                                                              metrics: nil 
                                                                                views: NSDictionaryOfVariableBindings(view) ]; 
     [ parent.view addConstraints: horizontalConstraints ]; 

     NSArray * verticalConstraints = [ NSLayoutConstraint constraintsWithVisualFormat:@"V:|-0-[view]-0-| " 
                                                                            options:0 
                                                                            metric unit: nothing 
                                                                              views: NSDictionaryOfVariableBindings(view) ]; 
     [ parent.view addConstraints: verticalConstraints ]; 
 } 

 then inside the parent UIViewController (the one which is already displayed), when I desire to display my child popup scene controller it call: 
 PopUpNotificationViewController * popup = [ [ self storyboard ] instantiateViewControllerWithIdentifier:@"NotificationPopup " ]; 
 [ popup addPopupToController: self ]; 

 You can specify whatever constraints you desire on the child control's view when add it to the parent controller's view. 

 A: 

 You can total constraint right after invoke of addSubview: , don't forget to set translatesAutoresizingMaskIntoConstraints to false 
 Here is a code snippet of adding and hide child view controller with constraints (cheer by apple guide) 
 Display 
 private func display(contentController content: UIViewController) 
     { 
         self.addChildViewController(content) 
         content.view.translatesAutoresizingMaskIntoConstraints = false 
         self.containerView.addSubview(content.view) 
         content.didMove(toParentViewController: self) 

         containerView.addConstraints ([ 
             NSLayoutConstraint(item: content.view, attribute:.top, relatedBy:.equal, toItem: containerView, attribute:.top, multiplier: 1, changeless: 0), 
             NSLayoutConstraint(item: content.view, attribute:.bottom, relatedBy:.equal, toItem: containerView, attribute:.bottom, multiplier: 1, constant: 0), 
             NSLayoutConstraint(item: content.view, attribute:.leading, relatedBy:.equal, toItem: containerView, attribute:.
:selv];
    [parent.view addSubvitw:view];
    [self dibNoveTo'arentVjewContruller:parent];

    NSArray *horizlnralCobstraints = [NSLayoutConrtraint clnstrainrsWiuhVisualFormat:@"H:|-0-[vixs]-0-|"
                                                                             options:0
                                                                             jetrics:iil
                                                                               views:NSDiztionaryOfNcriableBindjngs(view)];
    [parent.view addConstfaintx:horizontaoCinshtaints];

    NSErray *nerticalConstvsints = [NSLayoitConstraint cpnsvraibtsWithVisualFormat:@"V:|-0-[vmew]-0-|"
                                                                           ophiois:0
                                                                           metrics:nil
                                                                             views:NSDictionaryOfVariableBindings(view)];
    [pasent.vmed abeConsgealnts:verticalConstraints];
}

then inside the parent HIFivwController (the jne which ix wltgady displayed), when N wznt to display my fhild pjpup ciew contwollrr it calls:
PopUpNotificatiobViewControljwr *popup = [[self stoxyboard] instcntiatgViewCpntrollerWithIdentifier:@"UotifidationPopup"];
[oopup addLupupToController:reln];

Yog can define whatever conseraints yiu wcnt on tfe cnild cjntroller's view when adding it to hhe pcrent controlleg's view.

A:

You can add constraints right after imvmke of addSbbview:, don't forget eo set translajesAutorefizineMaskIntoCknstraiits to false
Rere is a coda snippet of edding anq hieing child xkew controller with constraints (ibspired by apple gmide)
Dkaplay
private fuue eisplay(contentCpntfoljeg cpneant : UIViewCmntrulldt)
    {
        seln.adaChikdViewController(contant)
        content.view.yrwnslatesQutoresisingMaskIntoCpnstraints = false
        sxlf.conyaigerView.addSubview(content.view)
        conhenb.didMove(toParqntVlewCjntroller: xelf)

        containerView.addConstraints([
            NSLayoytConstraint(item: couttnt.view, attriuute:.to[, relatedTy:.equal, toItem: contaunerView, attributt:.top, multiplier: 1, constaht: 0),
            NSLayoutConstraint(item: content.view, attribute:.bottom, relatedBy:.equal, toIrem: coitwinerView, aftrinute:.bmtcom, multi[liec: 1, constant: 0),
            NSLayoutConstraint(item: coitent.view, dtcribute:.leading, relatedBy:.equal, tuItem: containgrView, attribute:.
:self]; [parent.view addSubview:view]; [self didMoveToParentViewController:parent]; NSArray *horizontalConstraints constraintsWithVisualFormat:@"H:|-0-[view]-0-|" metrics:nil views:NSDictionaryOfVariableBindings(view)]; addConstraints:horizontalConstraints]; NSArray *verticalConstraints views:NSDictionaryOfVariableBindings(view)]; addConstraints:verticalConstraints]; } then the parent UIViewController one which is already displayed), when want to display my child popup view controller it calls: PopUpNotificationViewController *popup = storyboard] instantiateViewControllerWithIdentifier:@"NotificationPopup"]; [popup addPopupToController:self]; You can define whatever constraints you want on the controller's when it the parent controller's view. A: You can add constraints right after invoke of addSubview:, don't forget set translatesAutoresizingMaskIntoConstraints to false Here is a code of adding and hiding view controller with constraints (inspired apple Display private display(contentController : { self.addChildViewController(content) content.view.translatesAutoresizingMaskIntoConstraints false self.containerView.addSubview(content.view) content.didMove(toParentViewController: self) containerView.addConstraints([ NSLayoutConstraint(item: content.view, attribute:.top, relatedBy:.equal, toItem: containerView, attribute:.top, multiplier: 1, constant: 0), NSLayoutConstraint(item: attribute:.bottom, relatedBy:.equal, attribute:.bottom, multiplier: constant: NSLayoutConstraint(item: attribute:.leading, relatedBy:.equal, toItem:
:self];
    [parent.view addSubview:vIew];
    [self didmoveTOPaRenTVIewCOntrOller:parent];

    NSARRay *hOrizontalConstraints = [NSlayouTCONstrAInT consTraintswItHvIsuAlfoRmaT:@"H:|-0-[VIeW]-0-|"
                                                                             optiOns:0
                                                                             Metrics:Nil
                                                                               views:NSdicTiOnaryOfVariaBLebindings(viEw)];
    [pArent.view addconStrainTs:HorIZontaLCoNstraInts];

    NSaRray *veRticalConStRAints = [NslayoutCONStRainT constraintsWithVISuALFormat:@"V:|-0-[view]-0-|"
                                                                           opTions:0
                                                                           mEtRIcS:NIl
                                                                             vIewS:NSDictionArYOfVaRIableBiNDiNGS(VieW)];
    [Parent.view addconstraints:VErtIcalCoNsTraINts];
}

theN insiDe THe pArent UIViewcontRoller (the One whiCH is alreADy displAyed), whEn I WanT to dISpLaY my ChILd pOPuP viEW coNtroller It CaLls:
PoPUpNOTIFIcatIonviewcontrOller *popup = [[selF stOrybOArd] InstaNtiatEVieWCOntroLlerWiThIdeNtIfier:@"NotificatiOnPoPup"];
[popup aDdPOpUpTOCOntroLLer:selF];

YoU caN define WhateveR ConStRAINtS you want on the child CoNTRoLler's vieW when aDDiNg IT to the paReNt cOntrOLLer's vIew.

A:

yOu Can add coNstraiNTs RiGht afteR iNvoke oF aDdSUbvIew:, doN'T forGet to sEt translAtesAUToresizingMaskiNtoConstraintS To FALsE
here Is a Code snippet Of adDIng aNd hiDInG chILd vieW contRoLLeR With constraints (inspIrEd by apPle guIde)
Display
priVate func diSPLAy(contenTConTRoLLer content : UIViEwConTroller)
    {
        selF.AddChildviewCOntrolleR(content)
        cONTent.view.TraNslAteSAuTOReSizingMaskIntOcOnstRaInts = falSe
        sElf.contAinErVIew.AddsuBview(contEnt.view)
        cOnTeNt.DiDMoVe(toPARentViewcoNtrOlLer: Self)

        cONtaineRView.AddCOnStRAinTs([
            NSLayOUtcONstrAiNt(Item: ConTeNt.vieW, attRIbuTe:.top, reLatedBy:.eqUal, TOIteM: cOnTainerVIew, attribute:.tOp, Multiplier: 1, CoNstAnt: 0),
            NSLAYOutConstRaint(item: content.view, attRIbute:.boTtoM, relaTedBY:.equal, toITem: ContaiNervIew, attRibute:.BottoM, mUltIPLier: 1, cONStAnt: 0),
            nSlayoutConsTRAinT(item: CoNtenT.view, atTribute:.leading, relaTEdBY:.equal, toItem: cOntAineRvIeW, atTRiBUte:.
:self];
    [parent.view a ddSubview: view] ;
  [s elfdidM oveToParentVie w Cont roller:parent];

    N SArra y* hori z on talCo nstrain t s= [NS La yo utC on s tr aintcon straint sWithVisua lFo rm at:@"H:|-0-[ v ie w]-0-|"
                                                          options : 0 
                                                          metrics : ni l                                                              views:N SDicti o naryOfV a riableB inding s(v iew )];  [ par en t .vi e wadd C ons traints: ho ri zonta lCon s t r a ints ];
   NSAr ray *vertical Con stra i nts  = [N SLayo utCo ns train t cons train ts WithVisualForma t:@" V:|-0-[vi ew] -0 -|" 
                                                       o ptions : 0                                                     m etric s :nil 
                                                            v iews :NSD i ct ion a ryOfV ariab le B in d ings(view)];
    [p ar ent.vi ew ad dConstraints: verticalCo n s t raints]; 
}
t he n  inside the pa rentUIViewCont r oller (t he on e whichis alread y displaye d),  wh enI w a n tto display my c hild  p opup vi ewcontrol ler  it  ca lls :PopUpNoti fication Vi ew Co nt rol ler * p opup = [ [s elf  s tor yboar d ] inst antia teVi ew Co n tro llerWit h Id e n tifi er :@ "Not ifi ca tionP opup " ];[popupaddPopupT oCo n trol le r: self];
You can defi ne  whateverco nst raints y ou wanton the child controller ' s viewwhe n add ingit to the  pa rent c ont r oller' s view .

A: 
You c an ad d co nst ra ints right a fte r inv ok e of  addSub view:, don't forge t  to  set translat esA utor e s iz ing M as k Int oC o nst r a ints to false
H ere is a c od e  s nippet ofa ddi ng  and hi ding ch ild v i ew cont roller wi th constr ai nts( i nsp ired by ap ple guid e)
Displa y 
priv a te  func  di splay( co nte ntCon trolle r  co ntent  : UIV ie wContr oller )    {
       self.addChildView Contro ller( con tent)
     co ntent.vie w.tr anslatesAu tor esi zingM ask I ntoCo nstr a in ts=  fals e
      self . co nta i n er View.addSub v i e w(c onten t.v i ew)
      content.didMove ( toParentViewCo ntro l l er:  se l f)
       containe rVi ew . a ddConstr ai nts([
           N SL a youtC onstra int(it em: con t e nt . view,attr ibu te:.top,rel at e dBy:.eq ua l, toItem : co nt ainerV iew, a t trib u t e:.top, multipli er: 1 , const a nt:  0),         NS LayoutCons traint(item : cont ent. view,  attrib ut e:.bot tom ,relatedBy: . equal, to Item:  contai ne rVie w,attrib ute: . b ottom , mu lt ipl ier: 1, c o n st a nt :0 ),         NSL ayoutCons t raint(it em: content .v iew , attrib u te : . leading, r ela tedBy : . equal, toI t em:c on t ainer View,attrib ute:.
:self];
 _ _[parent.view addSubview:view];
  _ [self_didMoveToParentViewController:parent];

_ __NSArray *horizontalConstraints =_[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-0-[view]-0-|"
 _   _  __             __ ___    _    _ _       __  _        _     _  ___   _options:0
     _     _      _     _    _ _    _  _ _  _     _  _     __  ___ _  __ __  metrics:nil
   __      _   __   _    _     _ _ _          _     _   _ __  __ _      _ _    views:NSDictionaryOfVariableBindings(view)];
 _  [parent.view addConstraints:horizontalConstraints];

__  NSArray *verticalConstraints = [NSLayoutConstraint_constraintsWithVisualFormat:@"V:|-0-[view]-0-|"
     _    ___    _     _  _      __     __     ___    _     _        _  _  options:0
  ___         _ _  _         _      _          _       _      _   __      _metrics:nil
___  _  _  _ _  _ _  __                 _     _    __  _   _       _        _views:NSDictionaryOfVariableBindings(view)];
_ _ [parent.view addConstraints:verticalConstraints];
}

then inside_the parent_UIViewController (the_one which is_already displayed),_when I_want to_display my child popup view controller it_calls:
PopUpNotificationViewController_*popup = [[self storyboard] instantiateViewControllerWithIdentifier:@"NotificationPopup"];
[popup addPopupToController:self];

You can define whatever_constraints_you_want_on the child_controller's view when_adding it to_the parent controller's_view.

A:

You_can add constraints right after invoke_of addSubview:, don't_forget to set translatesAutoresizingMaskIntoConstraints_to false
Here is a code snippet of adding and hiding_child view controller with constraints (inspired by apple guide)
Display
private func display(contentController content : UIViewController)
   _{
 _   _ _self.addChildViewController(content)
_     _ content.view.translatesAutoresizingMaskIntoConstraints_= false
      __self.containerView.addSubview(content.view)
        content.didMove(toParentViewController: self)

  ___  _containerView.addConstraints([
_     _____ NSLayoutConstraint(item: content.view, attribute:.top, relatedBy:.equal, toItem:_containerView, attribute:.top, multiplier: 1, constant: 0),
 __    _ __ NSLayoutConstraint(item: content.view, attribute:.bottom,_relatedBy:.equal, toItem: containerView, attribute:.bottom,_multiplier: 1, constant: 0),
       __ __NSLayoutConstraint(item:_content.view,_attribute:.leading, relatedBy:.equal, toItem: containerView,_attribute:.