Skip to content

Instantly share code, notes, and snippets.

@daehn
daehn / ERROR_LOG.h
Last active August 29, 2015 14:17
Debug configuration error logging macro
#ifndef ERROR_LOG
#ifdef DEBUG
#define ERROR_LOG(error) if(error){NSLog(@"%s Error: %@", __PRETTY_FUNCTION__, error);}
#else
#define ERROR_LOG(error)
#endif
#endif
@daehn
daehn / DEBUG_LOG.h
Last active August 29, 2015 14:17
Debug configuration NSLog replacement
#ifndef DEBUG_LOG
#ifdef DEBUG
#define DEBUG_LOG(fmt, ...) NSLog(fmt, ##__VA_ARGS__)
#else
#define DEBUG_LOG(fmt, ...)
#endif
#endif
@daehn
daehn / Push & Pop.swift
Last active August 29, 2015 14:16
Swift Array convenience extention
extension Array {
mutating func pop() -> T? {
return self.removeAtIndex(0)
}
mutating func push(element: T) {
self.append(element)
}
}