title: Switch : Enum Switch issue : Not member of a int
body: <p>I am writing my first project in Swift(I have been doing ObjectiveC for years) and for some reason, I cant work out why my enum and Switch are not working togetber</p>
  
  <pre><code>enum ContactViewMode : Int
      {
          case ViewModeFavourite = 0
          case ViewModeRecent = 1
          case ViewModeContacts = 2
      }
  </code></pre>
  
  <p>Property</p>
  
  <pre><code> @IBInspectable var contactViewMode : Int!
  </code></pre>
  
  <p>Switch</p>
  
  <pre><code>switch contactViewMode {
              case ContactViewMode.ViewModeFavourite:
                  contacts = DBManager.getFavouriteContacts() as [ContactEntity]
              case ContactViewMode.ViewModeRecent:
                  contacts = DBManager.getFavouriteContacts() as [ContactEntity]
              default:
                  contacts = DBManager.getAllContacts() as [ContactEntity]
          }
  </code></pre>
  
  <p>The error I get is 
  <strong>Enum case 'ViewModeFavourite' is not a member of type 'Int!'</strong></p>
  
  <p>So I changed it to this as it is not a Int! (I need Int! for Storyboard)</p>
  
  <pre><code>var contactMode:Int = contactViewMode
  
          switch contactMode {
              case .ViewModeFavourite:
                  contacts = DBManager.getFavouriteContacts() as [ContactEntity]
              case .ViewModeRecent:
                  contacts = DBManager.getFavouriteContacts() as [ContactEntity]
              default:
                  contacts = DBManager.getAllContacts() as [ContactEntity]
          }
  </code></pre>
  
  <p>Then I get
   <strong>Enum case pattern cannot match values of the non-enum type 'Int'</strong></p>