<div dir="ltr"><span style="font-size:13px">Happy Friday everyone!</span><div style="font-size:13px"><br></div><div style="font-size:13px">I wonder why the protocol declaration should be only at the file scope?</div><div style="font-size:13px">Is this a design choice or limitation of the current implementation?</div><div style="font-size:13px"><br></div><div style="font-size:13px">I think, the ability of declaring protocols inside the other declarations would improve readability and code-organization.</div><div style="font-size:13px"><br></div><div style="font-size:13px">For example, instead of:</div><div style="font-size:13px"><br></div><blockquote style="font-size:13px;margin:0px 0px 0px 40px;border:none;padding:0px"><div>protocol UITableViewDelegate {</div><div>...</div><div>}</div><div><br></div><div>class UITableView {</div><div>    var delegate: UITableViewDelegate?</div><div>}</div></blockquote><div style="font-size:13px"><br></div><div style="font-size:13px">we would write:</div><div style="font-size:13px"><br></div><blockquote style="font-size:13px;margin:0px 0px 0px 40px;border:none;padding:0px"><div>class UITableView {</div><div><br></div></blockquote><blockquote style="font-size:13px;margin:0px 0px 0px 40px;border:none;padding:0px"><div>    protocol Delegate {</div><div>    ...</div><div>    }</div></blockquote><blockquote style="font-size:13px;margin:0px 0px 0px 40px;border:none;padding:0px"><div><br></div><div>    var delegate: Delegate?</div><div>}</div></blockquote><div style="font-size:13px"><br></div><div style="font-size:13px">Thanks</div></div>