The Cocoa’s target/action pattern works great with Objective-C, but can be difficult to work within Swift.
Mike ash has written a tutorial on implementing the target/action pattern in Swift for working with Cocoa, and avoiding memory management issues.
In the tutorial Mike shows how to implement the target/action pattern in Swift, and provides an example of how one could use it with UIKit, with a specific example of UIButton.
You can find the tutorial over on Mike Ash’s blog.
A nice guide for implementing the target/action pattern in Swift for working with Cocoa.
Submit A Resource
Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?
You can submit the url here.
The resources we feel will appeal to our readers the most will be posted on the front page.