Using APIs is fair use. If you can avoid using Apple code to do so, or only minimal ones, like headers, then I think you would be in the clear. See Google vs Oracle. IANAL of course and personally I wouldn't pursue this.
In the EU there's a "Computer Programs Directive" which grants us the right to go as far as to reverse engineer any licensed software for the purposes of interoperability.
Reverse engineering APIs is fair use, not simply using APIs. Eg when Google implemented their own implementation of Java APIs, that was deemed fair use. Google only copied the interface. The courts ruled you can build a competing product that copies an interface for compatibility, just like Compaq did with IBM’s BIOS. Google absolutely would have been on the hook had they used Oracle’s implementation of the APIs.