How can I present a ViewController from a touch point?











up vote
0
down vote

favorite
1












Is there any way to present a ViewController from a touch point or selected cell in a tableView or collectionView(which is in scrollView)?



Now I'm using a UIView to mimic presentation animation, but this is not the correct way to solve this problem and also make the code dirty. I can't compound UIViewControllerAnimatedTransitioning with the touched point. I tried Hero Transitions but they use a custom class for collectionView and not really helpful for my project.



I will be very appreciated for any help.










share|improve this question


























    up vote
    0
    down vote

    favorite
    1












    Is there any way to present a ViewController from a touch point or selected cell in a tableView or collectionView(which is in scrollView)?



    Now I'm using a UIView to mimic presentation animation, but this is not the correct way to solve this problem and also make the code dirty. I can't compound UIViewControllerAnimatedTransitioning with the touched point. I tried Hero Transitions but they use a custom class for collectionView and not really helpful for my project.



    I will be very appreciated for any help.










    share|improve this question
























      up vote
      0
      down vote

      favorite
      1









      up vote
      0
      down vote

      favorite
      1






      1





      Is there any way to present a ViewController from a touch point or selected cell in a tableView or collectionView(which is in scrollView)?



      Now I'm using a UIView to mimic presentation animation, but this is not the correct way to solve this problem and also make the code dirty. I can't compound UIViewControllerAnimatedTransitioning with the touched point. I tried Hero Transitions but they use a custom class for collectionView and not really helpful for my project.



      I will be very appreciated for any help.










      share|improve this question













      Is there any way to present a ViewController from a touch point or selected cell in a tableView or collectionView(which is in scrollView)?



      Now I'm using a UIView to mimic presentation animation, but this is not the correct way to solve this problem and also make the code dirty. I can't compound UIViewControllerAnimatedTransitioning with the touched point. I tried Hero Transitions but they use a custom class for collectionView and not really helpful for my project.



      I will be very appreciated for any help.







      ios swift animation uiviewcontroller uiscrollview






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 12 at 10:03









      GreatCornholio

      4117




      4117
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          4
          down vote













          You should use Custom presentation process.



          It is well described in ViewController Programming guide



          Basically you should do using the following steps:




          1. Create custom animator objects for presenting and dismissing your ViewController

          2. Adopt UIViewControllerTransitioningDelegate


          Nice tutorial on subject at raywenderlich.com






          share|improve this answer























          • :/ In that tutorial, they used a custom class for collectionView, they did their own collectionView which is inherited from scrollView. In our project, I can't do that. But this helps someone else, thank you.
            – GreatCornholio
            Nov 12 at 13:20










          • It's not necessary to subclass the CollectionView. All you need to show UIViewController by tapping on it is an initial frame of it. It doesn't matter how you retrieve it. I have a simple reference project. It might be easier to understand.
            – fewlinesofcode
            Nov 12 at 13:24











          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%2f53259804%2fhow-can-i-present-a-viewcontroller-from-a-touch-point%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








          up vote
          4
          down vote













          You should use Custom presentation process.



          It is well described in ViewController Programming guide



          Basically you should do using the following steps:




          1. Create custom animator objects for presenting and dismissing your ViewController

          2. Adopt UIViewControllerTransitioningDelegate


          Nice tutorial on subject at raywenderlich.com






          share|improve this answer























          • :/ In that tutorial, they used a custom class for collectionView, they did their own collectionView which is inherited from scrollView. In our project, I can't do that. But this helps someone else, thank you.
            – GreatCornholio
            Nov 12 at 13:20










          • It's not necessary to subclass the CollectionView. All you need to show UIViewController by tapping on it is an initial frame of it. It doesn't matter how you retrieve it. I have a simple reference project. It might be easier to understand.
            – fewlinesofcode
            Nov 12 at 13:24















          up vote
          4
          down vote













          You should use Custom presentation process.



          It is well described in ViewController Programming guide



          Basically you should do using the following steps:




          1. Create custom animator objects for presenting and dismissing your ViewController

          2. Adopt UIViewControllerTransitioningDelegate


          Nice tutorial on subject at raywenderlich.com






          share|improve this answer























          • :/ In that tutorial, they used a custom class for collectionView, they did their own collectionView which is inherited from scrollView. In our project, I can't do that. But this helps someone else, thank you.
            – GreatCornholio
            Nov 12 at 13:20










          • It's not necessary to subclass the CollectionView. All you need to show UIViewController by tapping on it is an initial frame of it. It doesn't matter how you retrieve it. I have a simple reference project. It might be easier to understand.
            – fewlinesofcode
            Nov 12 at 13:24













          up vote
          4
          down vote










          up vote
          4
          down vote









          You should use Custom presentation process.



          It is well described in ViewController Programming guide



          Basically you should do using the following steps:




          1. Create custom animator objects for presenting and dismissing your ViewController

          2. Adopt UIViewControllerTransitioningDelegate


          Nice tutorial on subject at raywenderlich.com






          share|improve this answer














          You should use Custom presentation process.



          It is well described in ViewController Programming guide



          Basically you should do using the following steps:




          1. Create custom animator objects for presenting and dismissing your ViewController

          2. Adopt UIViewControllerTransitioningDelegate


          Nice tutorial on subject at raywenderlich.com







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 12 at 10:21

























          answered Nov 12 at 10:12









          fewlinesofcode

          2,018518




          2,018518












          • :/ In that tutorial, they used a custom class for collectionView, they did their own collectionView which is inherited from scrollView. In our project, I can't do that. But this helps someone else, thank you.
            – GreatCornholio
            Nov 12 at 13:20










          • It's not necessary to subclass the CollectionView. All you need to show UIViewController by tapping on it is an initial frame of it. It doesn't matter how you retrieve it. I have a simple reference project. It might be easier to understand.
            – fewlinesofcode
            Nov 12 at 13:24


















          • :/ In that tutorial, they used a custom class for collectionView, they did their own collectionView which is inherited from scrollView. In our project, I can't do that. But this helps someone else, thank you.
            – GreatCornholio
            Nov 12 at 13:20










          • It's not necessary to subclass the CollectionView. All you need to show UIViewController by tapping on it is an initial frame of it. It doesn't matter how you retrieve it. I have a simple reference project. It might be easier to understand.
            – fewlinesofcode
            Nov 12 at 13:24
















          :/ In that tutorial, they used a custom class for collectionView, they did their own collectionView which is inherited from scrollView. In our project, I can't do that. But this helps someone else, thank you.
          – GreatCornholio
          Nov 12 at 13:20




          :/ In that tutorial, they used a custom class for collectionView, they did their own collectionView which is inherited from scrollView. In our project, I can't do that. But this helps someone else, thank you.
          – GreatCornholio
          Nov 12 at 13:20












          It's not necessary to subclass the CollectionView. All you need to show UIViewController by tapping on it is an initial frame of it. It doesn't matter how you retrieve it. I have a simple reference project. It might be easier to understand.
          – fewlinesofcode
          Nov 12 at 13:24




          It's not necessary to subclass the CollectionView. All you need to show UIViewController by tapping on it is an initial frame of it. It doesn't matter how you retrieve it. I have a simple reference project. It might be easier to understand.
          – fewlinesofcode
          Nov 12 at 13:24


















          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.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • 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%2f53259804%2fhow-can-i-present-a-viewcontroller-from-a-touch-point%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

          Bressuire

          Vorschmack

          Quarantine