4 Replies
      Latest reply on Aug 26, 2019 2:18 AM by mksmurali
      mksmurali Level 1 Level 1 (0 points)


          I am doing a  project in which the design/structure of the app will change based on web APIs.

        Is it possible to call web APIs just before the app Starts?

        • Re: Is it Possible to run a task before app starts?
          Claude31 Level 8 Level 8 (9,145 points)

          This is not clear.


          If you want to test web Api before app starts, you cannot do it in the app !

          How different are the 2 designs ? Could you illustrate with some examples


          So, you need to have a first app that tests and then launch the right app from there.


          But there is another way (if I understand what you want):

          you could also have both "designs" in the same app, Of course, you would have 2 variants of some struct, may be classes, may be some vars

          Then, for readability, you should adopt a naming that's explicit, like myVarCase1 and myVarCase2

          have a flag to test.

          this flag should be set in appDidFinishLaunching


          Then, everywhere, use the flag to know which version of objects to use.