Search code examples
haxe

How to find out if an interface is implemented?


How can I find out if an object implements an interface? In other words I need a possibility to check if an object can be cast to a specific type (e.g. a specific interface).


Solution

  • Std.is(). Or use a safe cast and it will throw an error if it fails.