Calling Objective - C delegate method in swift
<p>I have a method declared in Objective-C protocol:</p>

<pre><code>@protocol QMChatConnectionDelegate &lt;NSObject&gt;
@optional
- (void)chatServiceChatDidConnect:(QMChatService *)chatService;
</code></pre>

<p>I want to use this method as callback in my .swift file. My question what is difference between using <code>chatServiceChatDidConnect</code> method directly in class body or adding it as part of extension:</p>

<pre><code>class Chat: NSObject, QMChatConnectionDelegate
{
...
  func chatServiceChatDidConnect(chatService: QMChatService!) {
    print("connected")
  }
}
</code></pre>

<p>or </p>

<pre><code>class Chat: NSObject, QMChatConnectionDelegate
{
...
}

extension Chat: QMChatConnectionDelegate {
    func chatServiceChatDidConnect(chatService: QMChatService!) {
        print("connected")
    }
}
</code></pre>

<p>and do I need to declare it as <code>extension Chat : QMChatConnectionDelegate {}</code> or just <code>extension Chat {}</code></p>