「Swift」UIButtonのisEnabledのサンプル
書式
button.isEnabled =値
使用例
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var button: UIButton!
override func viewDidLoad() {
super.viewDidLoad()
// ボタン無効
button.isEnabled = false
// ボタン有効
button.isEnabled = true
}
}