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

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -