Does anyone have any idea why I can't register this UIButton being touched?
The function this should fire is:
@IBAction func buttonPressed(sender: AnyObject) {
print(321)
}
Maybe one thing to know about this view is that it's a ViewController holding a UIScrollView that is holding 3 ViewControllers itself that in turn is holding the UIButton.
So:
ViewController --> UIScrollView --> ViewController --> UIButton
Here's how I load those 2nd ViewControllers in my UIScrollView:
override func viewDidLoad() {
self.loadSuggestionCards()
}
func loadSuggestionCards() {
let screenSize: CGRect = UIScreen.mainScreen().bounds
let screenWidth = screenSize.width
let screenHeight = screenSize.height
self.scrollView.contentSize = CGSize(width:(Int(screenWidth)*itemList.count), height: Int(screenHeight))
self.scrollView.clipsToBounds = true
var viewXOffset : CGFloat = 0
for item in self.itemList {
let newViewController = ItemSuggestionsView()
newViewController.item = item
let view = newViewController.view
view.frame = CGRectMake(viewXOffset, 0, screenWidth, screenHeight)
self.scrollView.addSubview(view)
viewXOffset = viewXOffset + screenWidth
}
self.updateProgressView()
}

