function - Swift func - Does not conform to protocol "Boolean Type" -


yes it's man vs compiler time , compiler winning yet again! in func getrecordnumber returning bool , dictionary

func getrecordnumber(recordnumber: int32) -> (isgot: bool, dictlocations: dictionary <string, double>) ... return (isgot, dictlocations) 

however after have called func , question boolean isgot return error message

(isgot: bool, dictlocations: dictionary <string, double>) not conform protocol "boolean type"   

any ideas have left out?

you don't need add parameters return (isgot: bool, dictlocations: dictionary <string, double>). need tell compiler type function return.

here correct way achieve that:

func getrecordnumber(recordnumber: int32) -> (bool, dictionary <string, double>) {     let isgot = bool()     let dictlocations = [string: double]()      return (isgot, dictlocations) } 

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -