Skip to content

Instantly share code, notes, and snippets.

@maximveksler
Last active January 24, 2017 21:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maximveksler/3363115092f9eea72aae81a5238b02e6 to your computer and use it in GitHub Desktop.
Save maximveksler/3363115092f9eea72aae81a5238b02e6 to your computer and use it in GitHub Desktop.
Using #ifdef Xcode to detect debug builds in Swift
func _hackon_FacebookGET(_ stdin: FileHandle) -> Data {
#if Xcode
return "{\"httpMethod\":\"GET\", \"queryStringParameters\":{\"hub.mode\":\"subscribe\",\"hub.challenge\":\"56922036\",\"hub.verify_token\":\"Swift time is the best time\"},\"body\":null,\"isBase64Encoded\":false}".data(using: .utf8)!
#else
return stdin.readDataToEndOfFile()
#endif
}
let input = try Jay().jsonFromData(_hackon_FacebookGET(FileHandle.standardInput))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment