ifndef - Conditional exclusion of code in Swift -


i trying exclude parts of swift file specific target. yet did not find replacement of #ifndef objective-c directive , if use form of kind:

#if taxi_coops func pippo(){     println("pippo"); } #else func triggeractivelocationupdate(entering:bool){} #endif 

the preprocessor totally ignores directive , tries compile triggeractivelocationupdate. please note #if taxi_coops directive respected in other parts of same file.

is there way exclude pieces of code in swift and/or why fix not work?

in swift, use #if ! replacement #ifndef, e.g.:

#if !os(osx)     // compiled when not on os x #endif 

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -