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

twig - Using Twigbridge in a Laravel 5.1 Package -

Kivy: Swiping (Carousel & ScreenManager) -

jdbc - Not able to establish database connection in eclipse -