<div dir="ltr">I&#39;m currently updating some Swift 2.2 code to Swift 3.0. I had some Overloaded Operators that needed converting. I&#39;ve managed to get my code to compile and run. Although, looking to the community for any constructive criticism on my approach. <div><br></div><div>Regards</div><div><br></div><div><p style="margin:0px;font-size:12px;line-height:normal;font-family:&#39;helvetica neue&#39;;color:rgb(69,69,69)">import UIKit</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:&#39;helvetica neue&#39;;color:rgb(69,69,69)">import Foundation</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:&#39;helvetica neue&#39;;color:rgb(69,69,69);min-height:14px"><br></p><p style="margin:0px;font-size:12px;line-height:normal;font-family:&#39;helvetica neue&#39;;color:rgb(69,69,69)">func lines(input:String) -&gt; [String] {</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:&#39;helvetica neue&#39;;color:rgb(69,69,69)">    return input.components(separatedBy: NSCharacterSet.newlines)</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:&#39;helvetica neue&#39;;color:rgb(69,69,69)">}</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:&#39;helvetica neue&#39;;color:rgb(69,69,69);min-height:14px"><br></p><p style="margin:0px;font-size:12px;line-height:normal;font-family:&#39;helvetica neue&#39;;color:rgb(69,69,69)">func getContents(text:String) -&gt; String {</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:&#39;helvetica neue&#39;;color:rgb(69,69,69)">    let a = text.components(separatedBy: &quot;.&quot;)</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:&#39;helvetica neue&#39;;color:rgb(69,69,69)">    var temp = &quot;&quot;</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:&#39;helvetica neue&#39;;color:rgb(69,69,69)">    for (_,element) in a.enumerated(){</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:&#39;helvetica neue&#39;;color:rgb(69,69,69)">        temp = &quot;Value: \(temp) \(element) \n&quot;</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:&#39;helvetica neue&#39;;color:rgb(69,69,69)">    }</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:&#39;helvetica neue&#39;;color:rgb(69,69,69)">    return temp</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:&#39;helvetica neue&#39;;color:rgb(69,69,69)">}</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:&#39;helvetica neue&#39;;color:rgb(69,69,69);min-height:14px"><br></p><p style="margin:0px;font-size:12px;line-height:normal;font-family:&#39;helvetica neue&#39;;color:rgb(69,69,69)">precedencegroup FunctionalCompostion {</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:&#39;helvetica neue&#39;;color:rgb(69,69,69)">    associativity:left</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:&#39;helvetica neue&#39;;color:rgb(69,69,69)">}</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:&#39;helvetica neue&#39;;color:rgb(69,69,69);min-height:14px"><br></p><p style="margin:0px;font-size:12px;line-height:normal;font-family:&#39;helvetica neue&#39;;color:rgb(69,69,69)">infix operator &lt;&lt;&lt; : FunctionalCompostion</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:&#39;helvetica neue&#39;;color:rgb(69,69,69);min-height:14px"><br></p><p style="margin:0px;font-size:12px;line-height:normal;font-family:&#39;helvetica neue&#39;;color:rgb(69,69,69);min-height:14px"><br></p><p style="margin:0px;font-size:12px;line-height:normal;font-family:&#39;helvetica neue&#39;;color:rgb(69,69,69)">func  &lt;&lt;&lt;  &lt;A,B,C&gt; (g: @escaping (B) -&gt; C, f: @escaping (A) -&gt; B) -&gt; (A) -&gt; C {</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:&#39;helvetica neue&#39;;color:rgb(69,69,69)">    return { x in g(f(x)) }</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:&#39;helvetica neue&#39;;color:rgb(69,69,69)">}</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:&#39;helvetica neue&#39;;color:rgb(69,69,69);min-height:14px"><br></p><p style="margin:0px;font-size:12px;line-height:normal;font-family:&#39;helvetica neue&#39;;color:rgb(69,69,69)">let functionalWay =  lines &lt;&lt;&lt; getContents</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:&#39;helvetica neue&#39;;color:rgb(69,69,69);min-height:14px"><br></p><p style="margin:0px;font-size:14px;line-height:normal;font-family:menlo;color:rgb(255,255,255)">




























</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:&#39;helvetica neue&#39;;color:rgb(69,69,69)">functionalWay(&quot;K.w.a.m.e&quot;).count</p></div></div>