title: Redundant constraint 'Self' : 'AnyObject'
body: <p>I have this protocol:</p>
  
  <pre><code>protocol Container: class where Self: UIViewController {
      var containerView: UIView! { get }
      var currentChild: UIViewController? { get set }
      func remove(child viewController: UIViewController)
      func add(child viewController: UIViewController)
      func replaceCurrentViewController(with newChild: UIViewController)
  }
  </code></pre>
  
  <p>the problem I am facing is that it shows the following warning</p>
  
  <blockquote>
    <p>Redundant constraint 'Self' : 'AnyObject'</p>
  </blockquote>
  
  <p>this is because I am using both <strong>class</strong> &amp; <strong>where Self: UIViewController</strong>, but I need both! the reason for that is in my protocol extension (found below), I use UIViewController methods, and if I delete <strong>class</strong>, my extension shows an error asking for adding <strong>mutating</strong>, which it should not have because its a class only protocol.</p>
  
  <pre><code>extension Container {
      func remove(child viewController: UIViewController) {
          viewController.beginAppearanceTransition(false, animated: true)
          viewController.willMove(toParent: nil)
          viewController.removeFromParent()
          viewController.view.removeFromSuperview()
          viewController.endAppearanceTransition()
          currentChild = nil
      }
  
      func add(child viewController: UIViewController) {
          viewController.beginAppearanceTransition(true, animated: true)
          addChild(viewController)
          viewController.didMove(toParent: self)
          containerView.addSubview(viewController.view)
          viewController.view.frame = containerView.frame
          viewController.endAppearanceTransition()
          currentChild = viewController
      }
  
      func replaceCurrentViewController(with newChild: UIViewController) {
          if viewIfLoaded != nil, let currentChild = currentChild {
              if let parent = currentChild.parent, parent == self {
                  remove(child: currentChild)
              }
              add(child: newChild)
          }
      }
  }
  </code></pre>
  
  <p>so, is there a better solution? can I remove the warning?</p>