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