3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

PlayGround ではボタンなどのインタラクティブな操作はできない

Posted at

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)
// 操作できないスクロールとボタンが表示される
3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?