Scroll View 内の Container View に配置した UIボタン が反応しない
Container View にUIボタンの配置とカスタムクラスを設定していますが
カスタムクラス内のIBアクションが反応しないため、デリゲート等の設定がございましたらご教授ください。
Main.storyboad.swift
First scene
VIew
Scroll View
Container View (Test View Controller scene)
Test View Controller scene (カスタムクラス -> TestViewController.swift)
VIew
B (printButton)
TestViewController.swift
swift
1import UIKit 2class TestViewController: UIViewController { 3 @IBAction func testUiActionButton(_ sender: Any) { 4 self.printButton() 5 } 6 override func viewDidLoad() { 7 super.viewDidLoad() 8 } 9 func printButton(){ 10 print("test") 11 } 12} 13
コード共有をお願いします。
どのようにscrollview、containerviewとuibutoonを置いたのかなど
viewのUserInteractionEnabledのtrue/falseの設定ではないでしょうか
以下のリンクを参考にscrollviewやcontainerviewのUserInteractionEnabledをいじってみてください。
https://qiita.com/rc_code/items/f066d7dfa5c5a6da903a
違いました。
あなたの回答
tips
プレビュー