<div dir="ltr">I'm currently updating some Swift 2.2 code to Swift 3.0. I had some Overloaded Operators that needed converting. I'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:'helvetica neue';color:rgb(69,69,69)">import UIKit</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:'helvetica neue';color:rgb(69,69,69)">import Foundation</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:'helvetica neue';color:rgb(69,69,69);min-height:14px"><br></p><p style="margin:0px;font-size:12px;line-height:normal;font-family:'helvetica neue';color:rgb(69,69,69)">func lines(input:String) -> [String] {</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:'helvetica neue';color:rgb(69,69,69)"> return input.components(separatedBy: NSCharacterSet.newlines)</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:'helvetica neue';color:rgb(69,69,69)">}</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:'helvetica neue';color:rgb(69,69,69);min-height:14px"><br></p><p style="margin:0px;font-size:12px;line-height:normal;font-family:'helvetica neue';color:rgb(69,69,69)">func getContents(text:String) -> String {</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:'helvetica neue';color:rgb(69,69,69)"> let a = text.components(separatedBy: ".")</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:'helvetica neue';color:rgb(69,69,69)"> var temp = ""</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:'helvetica neue';color:rgb(69,69,69)"> for (_,element) in a.enumerated(){</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:'helvetica neue';color:rgb(69,69,69)"> temp = "Value: \(temp) \(element) \n"</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:'helvetica neue';color:rgb(69,69,69)"> }</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:'helvetica neue';color:rgb(69,69,69)"> return temp</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:'helvetica neue';color:rgb(69,69,69)">}</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:'helvetica neue';color:rgb(69,69,69);min-height:14px"><br></p><p style="margin:0px;font-size:12px;line-height:normal;font-family:'helvetica neue';color:rgb(69,69,69)">precedencegroup FunctionalCompostion {</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:'helvetica neue';color:rgb(69,69,69)"> associativity:left</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:'helvetica neue';color:rgb(69,69,69)">}</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:'helvetica neue';color:rgb(69,69,69);min-height:14px"><br></p><p style="margin:0px;font-size:12px;line-height:normal;font-family:'helvetica neue';color:rgb(69,69,69)">infix operator <<< : FunctionalCompostion</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:'helvetica neue';color:rgb(69,69,69);min-height:14px"><br></p><p style="margin:0px;font-size:12px;line-height:normal;font-family:'helvetica neue';color:rgb(69,69,69);min-height:14px"><br></p><p style="margin:0px;font-size:12px;line-height:normal;font-family:'helvetica neue';color:rgb(69,69,69)">func <<< <A,B,C> (g: @escaping (B) -> C, f: @escaping (A) -> B) -> (A) -> C {</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:'helvetica neue';color:rgb(69,69,69)"> return { x in g(f(x)) }</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:'helvetica neue';color:rgb(69,69,69)">}</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:'helvetica neue';color:rgb(69,69,69);min-height:14px"><br></p><p style="margin:0px;font-size:12px;line-height:normal;font-family:'helvetica neue';color:rgb(69,69,69)">let functionalWay = lines <<< getContents</p><p style="margin:0px;font-size:12px;line-height:normal;font-family:'helvetica neue';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:'helvetica neue';color:rgb(69,69,69)">functionalWay("K.w.a.m.e").count</p></div></div>