I have a UITabBarController with 5 tabs. I want to be able to present a ViewController over all of the tabs, just above the Tab Bar. Currently the issue I am having is that when I present the ViewController modally, it is not visible. I have this function called whenever I select a row within a tableView:
The tableView where showPlayerView
is called is defined like this:
class SearchResultsTableView: UIView, UITableViewDataSource, UITableViewDelegate
The class searchResultsTableView
is a view inside of another class defined like this:
TestViewController: UIViewController, UserSearchDelegate, UISearchBarDelegate, UITableViewDelegate, UITableViewDataSource, UINavigationBarDelegate, UINavigationControllerDelegate
Here is the actual function:
func showPlayerView() {
let playerView = PlayerView()
playerView.modalPresentationStyle = .overCurrentContext
CustomTabBarController.sharedInstance?.present(playerView, animated: true, completion: {
})
}
and I set up the CustomTabBarController sharedInstance like this:
static var sharedInstance : CustomTabBarController?
and inside viewDidLoad()
I have this:
CustomTabBarController.sharedInstance = self
Why can't I see my modal ViewController, and how can I get it to show on all screens?