Our BlogTips, Tricks, and Thoughts from Cerebral Gardens

StackSocial Essential Dev Tools Bundle Featuring Watchdog for Xcode

StackSocial Essential Dev Tools Bundle

Today, StackSocial launched the Essential Dev Tools Bundle for $49.99 USD. For the first time, developers can purchase Watchdog for Xcode outside of the Mac App Store. If you're a developer and you haven't purchased Watchdog yet, now is a great time. The version included in the bundle is not sandboxed which eliminates the hassle of having to grant Watchdog permission to access your drives. This is a major benefit to those of you using a RAM disk because with sandboxing you have to re-grant permission every time the RAM disk changes on reboots, remounts, etc. In addition to getting this amazing, non-sandboxed version of Watchdog for Xcode you'll be getting 7 other fantastic apps that will surely make you life as a developer much easier. Check them out below:

StackSocial Essential Dev Tools Bundle

That's a pretty great line-up of dev tools. StackSocial takes pride in curating the best in creative tech products so rest assured that this bundle will deliver. If you already have the MAS version of Watchdog and would benefit from the non-sandboxed version we'll be issuing an update soon that will let you convert your MAS license to a non-MAS license. You can learn more about Watchdog for Xcode here and grab the bundle here. 

Free Flat Apple TV Devices + Bonus Game Controller Mockups

Apple TV Freebie

The new Apple TV is finally here and we have some exciting apps in the pipeline that we are working on and can't wait to share them with you. In the meantime, I wanted to share some mockups I created during the development process. This set includes flat vectors of the new Apple TV and remote created with Adobe Illustrator. Includes .ai, .eps, and transparent .png files. Also included is a bonus game controller vector. Download and use these for applications, web sites, presentations, or any kind of project. They are free to use for personal and/or commercial projects. Remember to spread the love and share these freebies with your friends. Enjoy!

Game Controller Freebie


Rocket Podcast Episode 40: Sweater Weather & iMac Season

This week I had the pleasure of joining Christina Warren and Simone de Rochefort for some accelerated geek conversation on their podcast Rocket. On this episode you can hear us talk more about Rudoku, dig into the new iMacs, discuss Twitter’s latest reshuffling, and mourn the end of America’s Next Top Model. 

I was filling in for regular co-host Brianna Wu who was busy speaking at the Grace Hopper Celebration of Women in Computing in Houston. It’s the world’s largest gathering of women in tech and an all-around awesome event so be sure check it out. 

Rocket FM

Subscribe to Rocket on iTunes

Introducing Rudoku: A Numbers and Logic Game for Experts


We are so excited to announce the official launch of our new puzzle game, Rudoku! 

Rudoku is a nifty logic and numbers game for casual iPhone gamers.  Over here at Cerebral Gardens we love creating brain stimulating games and Rudoku is no exception. All you really need to solve the puzzles are basic math skills and you can make each puzzle as easy or as difficult as you like. We really strived to strike the right balance between minimal design and the right sounds and animations to make Rudoku a more relaxing experience.

We really love Rudoku, and we hope you do to. You can learn more about it here or go straight to the App Store and grab it. It’s just $1.99 USD ($2.29 CAD) with no in-app purchases. Pay once and enjoy endless playability. 

You can like Rudoku on Facebook or follow Rudoku on Twitter for more updates. 


The First Essential Swift 3rd Party Library to Include in Your Project

As we all scramble to learn this fantastic new language Apple gifted to us at WWDC 2014, we're coming across new ways of doing things, either because the new way is better, or because the old way is no longer possible.

One of the main features that Swift has taken away, is the C preprocessor. That's what enabled #define's to work. A common #define used is for debug logging, to include useful info with every line.

#define DLog(...) NSLog(@"%s(%p) %@", __PRETTY_FUNCTION__, self, [NSString stringWithFormat:__VA_ARGS__])

This lets us go from this:

NSLog(@"Simple Message");
2014-06-08 05:38:54.649 TestApp[35062:60b] Simple Message

to this:

DLog(@"Simple Message");
2014-06-08 05:38:54.649 TestApp[35062:60b] -[TSTAppDelegate application:didFinishLaunchingWithOptions:](0x10961f2e0) Simple Message

We now get a lot more info in our log messages and can see where in our code the log message came from without having to type it in for every line.

In Swift, we lost this functionality. The reason this was traditionally done with a #define, and not a function or class, is so that we can use the __PRETTY_FUNCTION__, __FUNCTION__, __FILE__, and __LINE__ macros. The preprocessor replaces those macros with their actual values. For example, __FILE__ will always contain the filename where the macro is placed for example. If you were to use them in a logging function, the macros would always contain the information of the logging function, not the calling function, rendering them useless.

This looked like it was going to be a major inconvenience in Swift so I filed a radar about it: http://openradar.appspot.com/17170702. After playing with Swift for a while, I've discovered a solution. I've built a library you can use in your projects.

Introducing XCGLogger

XCGLogger is my first open sourced third party library, that I think will be essential to add to your project.

The source can be found on GitHub here: https://github.com/DaveWoodCom/XCGLogger, with basic instructions on how to use it.

At a glance, it will change your logs from this:

Simple message

to this:

2014-06-09 06:44:43.600 [Debug] [AppDelegate.swift:40] application(_:didFinishLaunchingWithOptions:): Simple message

By writing code like this:

log.debug("Simple message")

instead of this:

println("Simple message")

A few things to note:

  1. Swift is brand new and in a state of flux, so it — and any libraries using it — will be subject to frequent changes.
  2. This is my first released library, so please let me know what you think and please share any ideas for improvement.
  3. There is a bug in Xcode 6 when using __FUNCTION__. XCGLogger uses a workaround for now, but will remove that once the bug is fixed. See: http://openradar.appspot.com/17219684
  4. This library is intended for use in Swift projects. There's no Objective-C compatibility included in it at this time. If it's a requested feature, it can be added.

Since Swift is brand new, there are a lot of different ways to accomplish the same thing. Over time, some best practices and patterns will emerge. I've used what I think are good practices and patterns in this library and hopefully they'll be helpful for developers as we work to establish what's best. For example, how to store static tokens for dispatch_once calls, shared instances, and global variables etc.

How does this work when I said earlier that using __FUNCTION__ and its friends in a function only gives you the information in the function instead of where it's called? Well, that's the secret sauce I discovered last week. If you set the default value of a parameter in a function to one of the macros, the compiler fills in that value at the calling location giving us the effect we need. Giving us access to the correct macro values inside the function that's called.

If you find this library helpful, you'll definitely find these other tools helpful:

Watchdog - monitors Xcode® and automatically cleans up stale cache files

Slender - cleans up Xcode projects, removing duplicate and/or unused assets

Briefs - powerful app prototyping, lets you and your clients try before you build

Follow me on Twitter @DaveWoodX