title: How would I write this typedef enum from objective c to swift?
body: <p>Below, I have the objective-c code which is used for tinder style animation effect , inspired by - <a href="https://github.com/ngutman/TinderLikeAnimations/tree/master/TinderLikeAnimations" rel="nofollow">https://github.com/ngutman/TinderLikeAnimations/tree/master/TinderLikeAnimations</a> .</p>
  
  <p><strong>Objective-c</strong></p>
  
  <pre><code>typedef NS_ENUM(NSUInteger , GGOverlayViewMode) {
      GGOverlayViewModeLeft,
      GGOverlayViewModeRight
  };
  
  - (void)setMode:(GGOverlayViewMode)mode
  {
      if (_mode == mode) return;
  
      _mode = mode;
      if (mode == GGOverlayViewModeLeft) {
          self.imageView.image = [UIImage imageNamed:@"button1"];
      } else {
          self.imageView.image = [UIImage imageNamed:@"button2"];
      }
  }
  </code></pre>
  
  <p>I am trying to replicate the same in swift. This is what I have in swift - </p>
  
  <pre><code>enum GGOverlayViewMode : Int {
      case GGOverlayViewModeLeft
      case GGOverlayViewModeRight
  }
  
      func setMode(mode: GGOverlayViewMode){
  //        if (_ mode == mode) {
  //            return
  //        }
  //
  //        _mode = mode;
  
          if(mode == GGOverlayViewMode.GGOverlayViewModeLeft) {
              imageView.image = UIImage(named: "button1")
          } else {
              imageView.image = UIImage(named: "button2")
          }
      }
  </code></pre>
  
  <p>But somehow its not making sense to how would I be handling the typdefs here.</p>
  
  <p>Any help is appreciated.</p>
  
  <p>Thanks</p>