I'm wondering if there is a way to limit the usage of a list of frameworks or APIs.
Take for example a class-room with shared computers where students will use SPM to create CLI programs to learn programming (i.e. not iOS development).
Is there a way to limit the compiler or somehow (at compile or even runtime) say - this code should not be able to load CoreData or Foundation.URLSession
Even if something that is not completely secure is OK, I'm just trying to to come up with valid ideas atm.
Could swizzling be used to prevent certain types from being created? Giving a runtime error if they are?
I guess there must also be a way to dynamically check whether a framework is loaded. Not certain how, though.
If the code doing this was made in objective c I guess you can even use the dynamic loading static method to have all of this swizzling run automatically just by linking to your framework?
Yes, swizzling is definitely something on my mind - it might a LOT of code though to swizzle every method in CoreData for example ... and that still doesn't take care of any global functions (if I remember right, didn't swizzle for many years).