1

I am trying to make a function so that I request a 'manager override' where it presents a screen for a manager to enter their password and press an approve button. How should I do this? Will it have to be in multiple functions? Is there a way that I can call one function and it present the information back? Would a completion work for what I need? I have no ideas where to start for this.

My set up is as follows:

A view controller asks for manager approval, then a screen slides up with text boxes and an approve button. I want the approve button to trigger authenticating and dismissing the screen

trever
  • 961
  • 2
  • 9
  • 28
  • For what it's worth, [my question here](http://stackoverflow.com/questions/43598597/call-a-file-download-function-from-multiple-view-controllers-how-to-return-resu/43598802?noredirect=1#comment74248540_43598802) addresses something similar, and was helpfully answered. Perhaps this may be helpful for others with questions similar to this one. – ConfusionTowers Apr 25 '17 at 14:46

1 Answers1

0

Assuming you don't want a Framework target (that sounds like overkill for what you want) simply mark the function as "public" and move it outside of any class. I just tried in a sample project and it works.

It looks important - remember to keep it in a file already in the project. (My sample project didn't work with menu option File|Add|New|File.)

Now, if you really want portability, check out how to create a Framework project.

  • Right, I know about that, what my issue is how to wait for the approve button to be hit in order to move on with the function, i need it to present the override view controller, *manager types information in*, *hits approve*, then the view controller either approves or deny it and passes the information back to the original function on the first screen that called it – trever Nov 30 '16 at 01:04