unexpectedly found nil when accessing another view controller’s functions

Hi,   I have a function in a file called ‘BaseViewController.swift’. And it works perfectly when I call it in viewDidLoad (in the same file).   func setFrontView(to view: UIView) {         if view == singlePlayerContainerView {             singlePlayerContainerView.isHidden = false             twoPlayerContainerView.isHidden = true…