Call interface BlueprintNativeEvent in editor from C++

I needed to call a BlueprintNativeEvent on an actor’s interface that exists in the editor world as part of a tool. I could not find a definitive post online, so for future reference here’s my solution:

Function definition in interface:

UFUNCTION(BlueprintNativeEvent, BlueprintCallable, CallInEditor, Category = "Actor IO")
void RegisterIOEvents(UPARAM(Ref) TArray<FActorIOEvent>& RegisteredEvents);
virtual void RegisterIOEvents_Implementation(TArray<FActorIOEvent>& RegisteredEvents) {}

Then calling it from the editor (with blueprint support):

TArray<FActorIOEvent> OutEvents;
if (MyActor && MyActor->Implements<UActorIOInterface>())
{
	IActorIOInterface::Execute_RegisterIOEvents(MyActor, OutEvents);
}