Button Not Firing Event Inside ScrollView
<p><code>UIButton</code>s inside <code>scrollview</code> are not firing event. I tried setting <code>exclusiveTouch delaysTouchesEvent</code>, but nothing helped.</p>

<pre><code>class TestViewController: UIViewController {

    @IBOutlet weak var scrollView: UIScrollView!
    var categoryArr = ["Jack","Mark","Down","Bill","Steve"]
    var buttonColors = [UIColor.greenColor(), UIColor.blueColor(), UIColor.blackColor(), UIColor.cyanColor(), UIColor.magentaColor()]

    override func viewDidLoad() {
        super.viewDidLoad()
        let scrollingView = colorButtonsView(CGSizeMake(150,scrollView.frame.size.height), buttonCount: 5)
        scrollView.contentSize = scrollingView.frame.size
        scrollView.addSubview(scrollingView)
        scrollView.showsVerticalScrollIndicator = false
        scrollView.delegate = self
        scrollView.pagingEnabled = true
        scrollView.indicatorStyle = .Default
        scrollView.canCancelContentTouches = false
        scrollView.delaysContentTouches = false
        scrollView.exclusiveTouch = true
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }

    func colorButtonsView(buttonSize:CGSize, buttonCount:Int) -&gt; UIView  {
        let buttonView = UIView()
        buttonView.frame.origin = CGPointMake(0,0)
        let padding = CGSizeMake(10, 10)
        buttonView.frame.size.width = (buttonSize.width + padding.width) * CGFloat(buttonCount)
        var buttonPosition = CGPointMake(padding.width * 0.5, padding.height)
        let buttonIncrement = buttonSize.width + padding.width
        for i in 0...(buttonCount - 1)  {
            var button = UIButton.buttonWithType(.Custom) as! UIButton
            button.frame.size = buttonSize
            button.frame.origin = buttonPosition
            buttonPosition.x = buttonPosition.x + buttonIncrement
            button.setTitle(categoryArr[i], forState: UIControlState.Normal)
            button.addTarget(self, action: "showTheNextButton:", forControlEvents: UIControlEvents.TouchUpInside)
            button.backgroundColor = buttonColors[i]
            buttonView.addSubview(button)
        }
        return buttonView
    }

    func showTheNextButton(sender:UIButton){
        print("ok show the next button")
    }
}

extension TestViewController:UIScrollViewDelegate{
    func scrollViewDidEndDecelerating(scrollView: UIScrollView) {

        let index = round(scrollView.contentOffset.x / scrollView.frame.size.width)
        print(index)
    }
}
</code></pre>

<p><a href="https://i.stack.imgur.com/omxDC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/omxDC.png" alt="enter image description here"></a></p>