title: Delegate methods in Objective-C and viewcontroller in Swift. How to call protocols? - iOS
body: <p>I have view controller like in Swift:</p>
  
  <pre><code>class ViewController: UIViewController, DraggableViewDelegate {
  </code></pre>
  
  <p>(Type viewcontroller does not conform to protocol 'DraggableviewDelegate')</p>
  
  <p>I knew that I have to take protocol methods from delegate class, but it was a in Objective-C like:</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  #import "OverlayView.h"
  
  @protocol DraggableViewDelegate &lt;NSObject&gt;
  
  -(void)cardSwipedLeft:(UIView *)card;
  -(void)cardSwipedRight:(UIView *)card;
  
  @end
  
  @interface DraggableView : UIView
  
  @property (weak) id &lt;DraggableViewDelegate&gt; delegate;
  
  @property (nonatomic, strong)UIPanGestureRecognizer   *panGestureRecognizer;
  @property (nonatomic)CGPoint originalPoint;
  @property (nonatomic,strong)OverlayView* overlayView;
  @property (nonatomic,strong)UILabel* information; 
  
  
  -(void)leftClickAction;
  -(void)rightClickAction;
  
  @end
  </code></pre>
  
  <p>Here the methods are in Objective-C:</p>
  
  <pre><code> -(void)method {}
  </code></pre>
  
  <p>But in Swift it takes:</p>
  
  <pre><code>func methodName(){}
  </code></pre>