I am nearing completion of my first SpriteKit project so I have been reading about the best way to hide all println() statements for release. The best way I found is as described here (Remove println() for release version iOS Swift).
So basically I have set my own custom println function at global scope like this
func println(object: Any) {
Swift.println(object)
}
I haven't played around with the DEBUG Flag thing to do it automatically, for now I just comment the second line out. It works as expected, however I realised it is causing me some issues with my IAPs, specifically it crashes in this bit of code (and properly will at some other spots too).
func paymentQueue(queue: SKPaymentQueue!, updatedTransactions transactions: [AnyObject]!) {
/* Payments */
println("ADD PAYMENT")
for transaction:AnyObject in transactions {
var trans = transaction as! SKPaymentTransaction
println(trans.error) //CRASH IS HERE
As soon as I remove this global println function it doesn't crash anymore. Any suggestions on why this is happening or if there is another way to stop all printlns. Obviously I could for now just do it manually, but it would be a bit of a pain since I like my printlns. I would appreciate any tips and tricks. Thank you