This article aims to describe how to hook Swift functions.
Thanks to help from @NightwindDev for discussion and testing.
Overall, the idea is simple:
Write our own Swift code that will have the same calling convention as the target code,
then get a pointer to our own code and the target code, and call MSHookFunction
with
these values.