STOP PRESS: Updated for Swift 2.0 here! How function parameters work in Swift can be a little confusing, here’s an attempt to make it clearer: 1. func By default parameters of funcs do not have external names: [sourcecode language=”objc”] func…
STOP PRESS: Updated for Swift 2.0 here! How function parameters work in Swift can be a little confusing, here’s an attempt to make it clearer: 1. func By default parameters of funcs do not have external names: [sourcecode language=”objc”] func…
Setting up my cross-platform AIR app to publish to facebook/twitter was more challenging than I expected. Adobe Social ANE The Social ANE included in the Adobe Gaming SDK had three problems: Only works on iOS Not possible to force a publish…
Events Well, this is the final blog post in the series of communication between objects and for something familiar, events are available in Objective C and Swift too. The equivalent of ActionScript’s EventDispatcher is called NSNotificationCenter. Rather than each display…
Blocks/Closures Blocks are another way that Objective C performs callbacks. Flash and Swift uses this technique as well, where they are called closures. Basically this involves passing in a function/method/message to the child, whilst maintaining the focus of the parent.…
Delegates Rather than passing the method itself to be called back, another callback strategy is to pass in an object that contains the callback methods. Delegation is such a design pattern, another way that children in Objective C and Swift…
Actions in Objective C and Swift One way that Cocoa implements callbacks using Actions in the Interface Builder. Some display objects can call actions in your ViewController. You can connect the object to a method in your custom ViewController class…
When I began using Objective C, coming from ActionScript, I was a little overwhelmed at the myriad ways that a child component can send messages to its parent. ActionScript seems sort of easy now, since generally (at least since AS3)…
You must be logged in to post a comment.