"The interaction's view (or an ancestor) must have an associated view controller for presentation to work."
The UIWindow has a rootViewController...the stand-alone Navigation bar is a subview of the UIWindow... and I add the menu to the navigation bar with:
UIBarButtonItem *options = [[UIBarButtonItem alloc] initWithImage:[UIImage systemImageNamed:@"list.bullet"] menu:[windowmenu menu]];
The entire application is generated programmatically, not using Interface Builder so maybe I am not hooking things up correctly, or need to add something I am missing.
Do I need to connect the UIViewController to the UINavigationBar, UITableView etc somehow?
Ok, going to answer my own question. The problem was I was creating the UIWindow manually but I was not using the view returned by UIViewController's "view" property, and then hiding the UITransitionView since it was blocking the rest of the content, therefore the content, including the UINavigationBar and the UITableView that had menus attached to them were not direct descendants of the UIViewController, thus when the system traversed the hierarchy up, it did not find a UIViewController to present the menu, even though there was one in a different branch of the hierarchy of the UIWindow.
The fix is once the UIWindow is created with the UIViewController in the rootViewController, we query it's "view" property, which will trigger the creation of the UITransitionView hierarchy and since we aren't using nibs it will create a UIView taking up the entire content area. There we can attach the UINavigationBar and any other content, which will not be obstructed and be descendants of the UIViewController so it can be found and avoiding the error in the title of this question.