Present ViewControllers Modally inside Parent ViewController UIViewHow can I make a UITextField move up when the keyboard is present - on starting to edit?Modal viewController presented from UITabBarControllerInstantiate and Present a viewController in SwiftLeaking views when changing rootViewController inside transitionWithViewDismissing multiple view controllers showing wrong view during transitionprogrammatically present and dismiss modal viewController from show navigation stackSwift | Dismiss ViewController and Push other ViewControllerWKWebView action sheet dismisses the presenting view controller after being dismissedDismissing Modally Presented VC and Popping Presenting VCPresenting viewcontroller over current context is modal and does not rotate correctly

Visiting the UK as unmarried couple

Are taller landing gear bad for aircraft, particulary large airliners?

Why is delta-v is the most useful quantity for planning space travel?

Resetting two CD4017 counters simultaneously, only one resets

Is the next prime number always the next number divisible by the current prime number, except for any numbers previously divisible by primes?

Have I saved too much for retirement so far?

What should I use for Mishna study?

What to do when my ideas aren't chosen, when I strongly disagree with the chosen solution?

Can the harmonic series explain the origin of the major scale?

The most efficient algorithm to find all possible integer pairs which sum to a given integer

Why are on-board computers allowed to change controls without notifying the pilots?

Calculating the number of days between 2 dates in Excel

What was required to accept "troll"?

Could solar power be utilized and substitute coal in the 19th century?

Would it be legal for a US State to ban exports of a natural resource?

How to check participants in at events?

Is there any significance to the Valyrian Stone vault door of Qarth?

Blender - show edges angles “direction”

Perfect riffle shuffles

How can I successfully establish a nationwide combat training program for a large country?

Can a controlled ghast be a leader of a pack of ghouls?

What is the opposite of 'gravitas'?

Teaching indefinite integrals that require special-casing

Did US corporations pay demonstrators in the German demonstrations against article 13?



Present ViewControllers Modally inside Parent ViewController UIView


How can I make a UITextField move up when the keyboard is present - on starting to edit?Modal viewController presented from UITabBarControllerInstantiate and Present a viewController in SwiftLeaking views when changing rootViewController inside transitionWithViewDismissing multiple view controllers showing wrong view during transitionprogrammatically present and dismiss modal viewController from show navigation stackSwift | Dismiss ViewController and Push other ViewControllerWKWebView action sheet dismisses the presenting view controller after being dismissedDismissing Modally Presented VC and Popping Presenting VCPresenting viewcontroller over current context is modal and does not rotate correctly













0















I have one main ViewController, which will render different views from other view controllers (mostly table views), by using addChild:Vc i can present and remove the child view, but the problem is it's a view hierarchy, so view layers will come over each other and every child view has a button which will dismiss itself and re-presents the previous view in view hierarchy. exactly like Navigation Bar back button.



enter image description here



So far what i have done is an UIViewController Extension which is:



func addChildVC(_ child: UIViewController,
centerWith center: CGPoint? = CGPoint(x: 0.0, y: 0.0),
insertInView insertIn: UIView? = nil,
transition: UIView.AnimationOptions? = [],
completion: ((Bool) -> Void)? = nil)

self.addChild(child)

if let center = center

child.view.center = center


if let insertIn = insertIn

insertIn.insertSubview(child.view, aboveSubview: insertIn.self)
else
self.view.addSubview(child.view)


child.didMove(toParent: self)


func removeChildVC()

willMove(toParent: nil)
view.removeFromSuperview()
removeFromParent()










share|improve this question


























    0















    I have one main ViewController, which will render different views from other view controllers (mostly table views), by using addChild:Vc i can present and remove the child view, but the problem is it's a view hierarchy, so view layers will come over each other and every child view has a button which will dismiss itself and re-presents the previous view in view hierarchy. exactly like Navigation Bar back button.



    enter image description here



    So far what i have done is an UIViewController Extension which is:



    func addChildVC(_ child: UIViewController,
    centerWith center: CGPoint? = CGPoint(x: 0.0, y: 0.0),
    insertInView insertIn: UIView? = nil,
    transition: UIView.AnimationOptions? = [],
    completion: ((Bool) -> Void)? = nil)

    self.addChild(child)

    if let center = center

    child.view.center = center


    if let insertIn = insertIn

    insertIn.insertSubview(child.view, aboveSubview: insertIn.self)
    else
    self.view.addSubview(child.view)


    child.didMove(toParent: self)


    func removeChildVC()

    willMove(toParent: nil)
    view.removeFromSuperview()
    removeFromParent()










    share|improve this question
























      0












      0








      0








      I have one main ViewController, which will render different views from other view controllers (mostly table views), by using addChild:Vc i can present and remove the child view, but the problem is it's a view hierarchy, so view layers will come over each other and every child view has a button which will dismiss itself and re-presents the previous view in view hierarchy. exactly like Navigation Bar back button.



      enter image description here



      So far what i have done is an UIViewController Extension which is:



      func addChildVC(_ child: UIViewController,
      centerWith center: CGPoint? = CGPoint(x: 0.0, y: 0.0),
      insertInView insertIn: UIView? = nil,
      transition: UIView.AnimationOptions? = [],
      completion: ((Bool) -> Void)? = nil)

      self.addChild(child)

      if let center = center

      child.view.center = center


      if let insertIn = insertIn

      insertIn.insertSubview(child.view, aboveSubview: insertIn.self)
      else
      self.view.addSubview(child.view)


      child.didMove(toParent: self)


      func removeChildVC()

      willMove(toParent: nil)
      view.removeFromSuperview()
      removeFromParent()










      share|improve this question














      I have one main ViewController, which will render different views from other view controllers (mostly table views), by using addChild:Vc i can present and remove the child view, but the problem is it's a view hierarchy, so view layers will come over each other and every child view has a button which will dismiss itself and re-presents the previous view in view hierarchy. exactly like Navigation Bar back button.



      enter image description here



      So far what i have done is an UIViewController Extension which is:



      func addChildVC(_ child: UIViewController,
      centerWith center: CGPoint? = CGPoint(x: 0.0, y: 0.0),
      insertInView insertIn: UIView? = nil,
      transition: UIView.AnimationOptions? = [],
      completion: ((Bool) -> Void)? = nil)

      self.addChild(child)

      if let center = center

      child.view.center = center


      if let insertIn = insertIn

      insertIn.insertSubview(child.view, aboveSubview: insertIn.self)
      else
      self.view.addSubview(child.view)


      child.didMove(toParent: self)


      func removeChildVC()

      willMove(toParent: nil)
      view.removeFromSuperview()
      removeFromParent()







      ios swift xcode






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 7 at 10:11









      ShahriarShahriar

      135




      135






















          1 Answer
          1






          active

          oldest

          votes


















          0














          You need a navigation for the contained vc



          Step 1



          enter image description here



          Step 2 select the child vc and



          enter image description here



          Step 3



          enter image description here



          Now you can push and pop inside that child vc






          share|improve this answer






















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55041157%2fpresent-viewcontrollers-modally-inside-parent-viewcontroller-uiview%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            You need a navigation for the contained vc



            Step 1



            enter image description here



            Step 2 select the child vc and



            enter image description here



            Step 3



            enter image description here



            Now you can push and pop inside that child vc






            share|improve this answer



























              0














              You need a navigation for the contained vc



              Step 1



              enter image description here



              Step 2 select the child vc and



              enter image description here



              Step 3



              enter image description here



              Now you can push and pop inside that child vc






              share|improve this answer

























                0












                0








                0







                You need a navigation for the contained vc



                Step 1



                enter image description here



                Step 2 select the child vc and



                enter image description here



                Step 3



                enter image description here



                Now you can push and pop inside that child vc






                share|improve this answer













                You need a navigation for the contained vc



                Step 1



                enter image description here



                Step 2 select the child vc and



                enter image description here



                Step 3



                enter image description here



                Now you can push and pop inside that child vc







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 7 at 10:16









                Sh_KhanSh_Khan

                46.3k51432




                46.3k51432





























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55041157%2fpresent-viewcontrollers-modally-inside-parent-viewcontroller-uiview%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    1928 у кіно

                    Захаров Федір Захарович

                    Ель Греко