UIScrollView の動作を確認したくて PlayGrounde で試してみたが、どうにもスクロールできないのでおかしいなと思ったら、ボタンも押せなかった。
どうやら PlayGround ではイベントに反応するインタラクティブな動作の確認はできないらしい。
import UIKit
let vw = UIView(frame: CGRectMake(0,0,300,300))
vw.backgroundColor = UIColor(white: 0.9, alpha: 1.0)
let button = UIButton(frame: CGRectMake(10,10,100,100))
//button.buttonType = .System
button.setTitle("Push me!", forState: .Normal)
button.setTitleColor(UIColor.blackColor(), forState: .Normal)
vw.addSubview(button)
let scroll = UIScrollView(frame: CGRectMake(0,0,100,100))
scroll.scrollEnabled = true
scroll.contentSize = vw.frame.size
scroll.scrollEnabled = true
scroll.addSubview(vw)
// 操作できないスクロールとボタンが表示される