<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body dir="auto">
<div></div>
<div>Hi I was wondering if i could get some suggestions on this:</div>
<div><br>
</div>
<div>
<p style="margin: 0px; font-size: 14px; line-height: normal; font-family: Helvetica; color: rgb(112, 61, 170);">
<span style="font-size: 14pt; font-variant-ligatures: no-common-ligatures; color: rgb(186, 45, 162);">extension</span><span style="font-size: 14pt; font-variant-ligatures: no-common-ligatures; color: rgb(4, 51, 255);">
</span><span style="font-size: 14pt; font-variant-ligatures: no-common-ligatures;">CGPoint</span><span style="font-size: 14pt; font-variant-ligatures: no-common-ligatures; color: rgb(4, 51, 255);"> :
</span><span style="font-size: 14pt; font-variant-ligatures: no-common-ligatures;">Comparable</span></p>
<p style="margin: 0px; font-size: 14px; line-height: normal; font-family: Helvetica; color: rgb(4, 51, 255);">
<span style="font-size: 14pt; font-variant-ligatures: no-common-ligatures;">{</span></p>
<p style="margin: 0px; font-size: 14px; line-height: normal; font-family: Helvetica; color: rgb(4, 51, 255);">
<span style="font-size: 14pt; font-variant-ligatures: no-common-ligatures;"> </span><span style="font-size: 14pt; font-variant-ligatures: no-common-ligatures; color: rgb(186, 45, 162);">static</span><span style="font-size: 14pt; font-variant-ligatures: no-common-ligatures;">
</span><span style="font-size: 14pt; font-variant-ligatures: no-common-ligatures; color: rgb(186, 45, 162);">func</span><span style="font-size: 14pt; font-variant-ligatures: no-common-ligatures;"> <(l:
</span><span style="font-size: 14pt; font-variant-ligatures: no-common-ligatures; color: rgb(121, 121, 121);">CGPoint</span><span style="font-size: 14pt; font-variant-ligatures: no-common-ligatures;">, r:
</span><span style="font-size: 14pt; font-variant-ligatures: no-common-ligatures; color: rgb(121, 121, 121);">CGPoint</span><span style="font-size: 14pt; font-variant-ligatures: no-common-ligatures;">) -> </span></p>
<p style="margin: 0px; font-size: 14px; line-height: normal; font-family: Helvetica; color: rgb(4, 51, 255);">
<span style="font-size: 14pt; font-variant-ligatures: no-common-ligatures; color: rgb(121, 121, 121);"> Bool</span><span style="font-size: 14pt; font-variant-ligatures: no-common-ligatures;">{</span></p>
<p style="margin: 0px; font-size: 14px; line-height: normal; font-family: Helvetica; color: rgb(186, 45, 162);">
<span style="font-size: 14pt; font-variant-ligatures: no-common-ligatures; color: rgb(4, 51, 255);"><span class="Apple-tab-span" style="white-space:pre"></span></span><span style="font-size: 14pt; font-variant-ligatures: no-common-ligatures;">return</span><span style="font-size: 14pt; font-variant-ligatures: no-common-ligatures; color: rgb(4, 51, 255);">
</span><span style="font-size: 14pt; font-variant-ligatures: no-common-ligatures;">true</span><span style="font-size: 14pt; font-variant-ligatures: no-common-ligatures; color: rgb(4, 51, 255);">;</span></p>
<p style="margin: 0px; font-size: 14px; line-height: normal; font-family: Helvetica; color: rgb(4, 51, 255);">
<span style="font-size: 14pt; font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space:pre"></span>}</span></p>
<p style="margin: 0px; font-size: 14px; line-height: normal; font-family: Helvetica; color: rgb(4, 51, 255); min-height: 16.1px;">
<span style="font-size: 14pt; font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space:pre"></span></span></p>
<p style="margin: 0px; font-size: 14px; line-height: normal; font-family: Helvetica;">
<span style="font-size: 14pt; font-variant-ligatures: no-common-ligatures;"><font color="#0433ff"> </font></span><span style="color: rgb(186, 45, 162); font-size: 14pt; font-variant-ligatures: no-common-ligatures;">static</span><span style="color: rgb(4, 51, 255); font-size: 14pt; font-variant-ligatures: no-common-ligatures;">
</span><span style="color: rgb(186, 45, 162); font-size: 14pt; font-variant-ligatures: no-common-ligatures;">func</span><span style="color: rgb(4, 51, 255); font-size: 14pt; font-variant-ligatures: no-common-ligatures;"> ==(l:
</span><span style="color: rgb(121, 121, 121); font-size: 14pt; font-variant-ligatures: no-common-ligatures;">CGPoint</span><span style="color: rgb(4, 51, 255); font-size: 14pt; font-variant-ligatures: no-common-ligatures;">, r:
</span><span style="color: rgb(121, 121, 121); font-size: 14pt; font-variant-ligatures: no-common-ligatures;">CGPoint</span><span style="color: rgb(4, 51, 255); font-size: 14pt; font-variant-ligatures: no-common-ligatures;">) -> </span></p>
<p style="margin: 0px; font-size: 14px; line-height: normal; font-family: Helvetica;">
<span style="color: rgb(121, 121, 121); font-size: 14pt; font-variant-ligatures: no-common-ligatures;"> Bool</span><span style="color: rgb(4, 51, 255); font-size: 14pt; font-variant-ligatures: no-common-ligatures;">{</span></p>
<p style="margin: 0px; font-size: 14px; line-height: normal; font-family: Helvetica; color: rgb(186, 45, 162);">
<span style="font-size: 14pt; font-variant-ligatures: no-common-ligatures; color: rgb(4, 51, 255);"><span class="Apple-tab-span" style="white-space:pre"></span> </span><span style="font-size: 14pt; font-variant-ligatures: no-common-ligatures;">return</span><span style="font-size: 14pt; font-variant-ligatures: no-common-ligatures; color: rgb(4, 51, 255);">
</span><span style="font-size: 14pt; font-variant-ligatures: no-common-ligatures;">true</span><span style="font-size: 14pt; font-variant-ligatures: no-common-ligatures; color: rgb(4, 51, 255);">;</span></p>
<p style="margin: 0px; font-size: 14px; line-height: normal; font-family: Helvetica; color: rgb(4, 51, 255);">
<span style="font-size: 14pt; font-variant-ligatures: no-common-ligatures;"><span class="Apple-tab-span" style="white-space:pre"></span>}</span></p>
<p style="margin: 0px; font-size: 14px; line-height: normal; font-family: Helvetica; color: rgb(4, 51, 255);">
<span style="font-size: 14pt; font-variant-ligatures: no-common-ligatures;">}</span></p>
<p style="margin: 0px; font-size: 14px; line-height: normal; font-family: Helvetica; color: rgb(4, 51, 255);">
<span style="font-size: 14pt; font-variant-ligatures: no-common-ligatures;"><br>
</span></p>
<p style="margin: 0px; line-height: normal; font-family: Helvetica; color: rgb(4, 51, 255);">
<span style="font-size: 18.66666603088379px;">CGPoint is a Core graphics struct. </span></p>
<p style="margin: 0px; line-height: normal; font-family: Helvetica; color: rgb(4, 51, 255);">
<span style="font-size: 18.66666603088379px;">This code gives me an error "Declaration is only valid at file scope". However per swift documentation, I cannot add an access modifier to extensions that adopt protocols. I was wondering if there is an elegant
workaround for this limitation or if there's something I'm missing here. </span></p>
<p style="margin: 0px; line-height: normal; font-family: Helvetica; color: rgb(4, 51, 255);">
<span style="font-size: 18.66666603088379px;">Thanks. </span></p>
</div>
</body>
</html>