I did not add any code since I was hoping this was better than the code I have scattered…? I have a small app that basically calls some functions when button tapped:
-
listener() functions fires off after [buttonTapped]:
a. sets up the UI
b. calls the animation fuc() -
[buttonTapped] then calls:
a. recorder() func to setup the AV stuff
b. recordTimer()
i. recordTimer(): has a timer for 10 seconds -
[buttonTapped] then calls:
a. gatherInput() func:
i. has a scheduled timer with repeat: true
ii. a selector that calls levelTimerCallback() -
while timer is running(repeating) the levelTimerCallback() on a selctor:
a. IF statement to record while sound in threshold -
*** Now I need to call the decisionMaker() func ONLY after timer is done with its timed repeat – how can I do that since the timer() already calling a selector to keep running every time the timer() fires of on the repeat?
I have a function that is a timer(repeat) with a selector: calling a function to check sound threshold
ONCE timer is done with the repeat from the time frame
How then to call the decisionMaker() function as I pass the global variable of the average measurement so I can then decide if it is good or bad measurement to call my custom UIAlert