When trying to implement this:
extension UIViewController {
public var presentedViewController: UIViewController? {
return UIViewController()
}
}
I'm receiving the following error:
.../ExampleApp/ExampleAppTests/SpecExtensions.swift:41:59: Getter for 'presentedViewController' with Objective-C selector 'presentedViewController' conflicts with method 'presentedViewController()' with the same Objective-C selector
I'm using the same selector that UIViewController.h defines:
public var presentedViewController: UIViewController? { get }
Is the error misleading or am I just overlooking something? I've tried it with and without override
, public
, as a method, etc. No luck. However, I am able to override it if it's on a subclass of UIViewController, but not UIViewController itself.