I am writing an iOS application and have a child view controller that I am trying to reference. The child view controller is the delegate of the parent.
At the top of the parent view controller, I have: fileprivate var cameraViewController: CameraViewController<AnyObject>?
In viewDidLoad()
, I have
guard let cameraController = childViewControllers.first as? CameraViewController else {
fatalError("Check storyboard for missing CameraViewController")
}
cameraViewController = cameraController
However, I'm getting the error: Ambiguous reference to member 'first(where:)'
Can anyone explain to me why this is happening? I only have one child view controller for the parent.