How to know if something has reference semantic?

Worth reading this thread.

Unless we have "@realtime" attribute you'd need to avoid classes, many value types (like Strings, URLs, Arrays, Dictionaries), certain constructs (escaping closures, variadic functions), mutexes, semaphores, dispatch async calls, memory allocation, and to be absolutely sure you'd need to check resulting asm. I'd say all of this is nearly impossible / impractical to do 100% right manually, although in practice you'd be able to get 99% there.

But then, even if all that is done 100% correct, remember that a mere memory access on a system with virtual memory backed by secondary storage can take unbound time.. If I am not mistaken hard realtime system can't afford having virtual memory / paging.

On top of that, for deterministic response you need to know the worst case complexity of your algorithms - this would be quite a challenge to determine in general case.

Though I am curious, what is it the app you are doing.