Greetings and salutations, NSHipsters!
As the year winds down, it's a tradition here at NSHipster to ask you, dear readers, to offer up your favorite tricks and tips from the past year as gifts to your fellow hipsters. With iOS 9, El Capitan, brand new watch- and tvOS's, and the open-sourcing of some minor Apple-related tech, there's bound to be lots to share.
Submit your favorite piece of Swift or @objc
trivia, helpful hints, unexpected discoveries, useful workarounds, useless fascinations, or anything else you found cool this year. Just comment below!
If you need inspiration, try the list from last year, or from the year before, or from the year before that.
새해 복 많이 받으세요! 🎆
I did found it somewhere on stackowerflow.
For these, who like me, are trying to avoid the mess with -DDEBUG in Swift, but have to know, which version of executable is running, Debug or Release.
In code:
if DEBUG_BUILD {
debugPrint("It's Debug build")
} else {
debugPrint("It's Release build")
}
PreProcessorMacros.m:
include "PreProcessorMacros.h"
ifdef DEBUG
else
endif
PreProcessorMacros.h:
ifndef PreProcessorMacros_h
define PreProcessorMacros_h
include <Foundation/Foundation.h>
extern BOOL const DEBUG_BUILD;
endif /* PreProcessorMacros_h */
in Bridged header:
import "PreProcessorMacros.h"