title: How to create a empty variable that can take the value type of a class
body: <p>Hey I'm trying to figure out how to either set a variable to the type of an empty class. Like this if it weren't an error:</p>
  
  <p>Code:</p>
  
  <pre><code>  var PlayerEquipped = class() // failed attempt at trying set up a blank variable that can take the type of a class
  </code></pre>
  
  <p>Or make a variable that i can change in the future. So basically i can create a global variable like this with a class assigned to it with no problems.</p>
  
  <p>Code:</p>
  
  <pre><code>   var PlayerEquipped = House()
  
            //In another .swift file i have the 2 classes
  
      class House {
      init() {
       }
      }
  
      class House2 {
      init() {
       }
      }
  </code></pre>
  
  <p>But even though its setup with "var" i still get an error when i try to change that "SelectClass" variable to a different class. For example If i were to make a string variable with text "Hello" in-side then later down in my view did load decide to change that variable text to "GoddBye" it would let me do that. But if i try to change the "SelectedClass" Variable to a different class I get this error. It saying 'cannot assign value of type saintsRB to type saintsLB'
  Code:</p>
  
  <pre><code>      var PlayerEquipped = House()
  
     //down in view didload:
         PlayerEquipped = House2() // Error here
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/lOapN.png" rel="noreferrer"><img src="https://i.stack.imgur.com/lOapN.png" alt="Picture of Error"></a></p>