title: Cannot assign value of type '()' to type 'UIView?'
body: <p>I created a view for reuse. My plan is this: Show the same thing on ViewController with different content depending on the type.
  On view, you need to change the Label and background.The data comes from the server, for this I created the ViewModel. Depending on the type, I return the Label content and background color.</p>
  
  <p><strong>ViewModel.swift</strong></p>
  
  <pre><code>  class SomeViewModel{
          enum ViewType: Int {
              case oneViewType
              case twoViewType
          }
          //Example
            func getViewBackgroundColor() -&gt; UIColor {
                  switch ViewType {
                  case .oneViewType:
                      return .black
                  case .twoViewType :
                      return .white
                  }
              }
      }
  </code></pre>
  
  <p><strong>ViewControllerViewModel.swift</strong></p>
  
  <pre><code>class ViewControllerViewModel{
  
      var viewType: ViewType? = nil
  
      func getViewType(type: viewType)  {
  
          switch type {
          case .oneViewType:
              return
          case .twoViewType:
              return
          }
      }
  </code></pre>
  
  <p><strong>ViewController.swift</strong></p>
  
  <pre><code> class SomeViewController: UIViewController {
  
          @IBOutlet weak var oneView:UIView!
          @IBOutlet weak var twoView:UIView!
  
        var viewModel: SomeViewModel!
  
  
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
      }
      func configure(viewModel: ViewControllerViewModel) {
          self.viewModel = viewModel
  
     //ERROR : Cannot assign value of type '()' to type 'UIView?'
      oneView = self.SomeViewModel.getViewType(type: .oneViewType)
          }
  }
  </code></pre>
  
  <p>Error: Cannot assign value of type '()' to type 'UIView?'</p>