// // UIViewController+Extensions.swift // foray // // Created by Nicholas Tay on 24/3/2022. // import Foundation import UIKit protocol HasCustomView { associatedtype CustomView: UIView } extension HasCustomView where Self: UIViewController { internal var customView: CustomView { guard let view = self.view as? CustomView else { fatalError("Could not cast custom view") } return view } }