For some reason, in Swift 3 and Xcode 8, we're finding you can no longer connect views on Interface Builder storyboards e.g. UIButtons to IBAction functions when those functions defined in extensions. This has worked fine in previous versions of Xcode. As a concrete example...
The following code is fine:
class MyViewController: UIViewController {
@IBAction func myButtonTapped() {
// Do stuff when button tapped
}
}
However, in Xcode 8, this code won't allow connecitons to be made from Interface Builder:
class MyViewController: UIViewController {
}
extension MyViewController {
@IBAction func myButtonTapped() {
// Do stuff when button tapped
}
}
As I say, this has worked fine in previous versions of Xcode. Is this new behaviour expected in Swift 3 / Xcode 8, or is it a bug?