topViewというクラスに書いたbuttonのaddtargetでTopVeiwControllerという違うクラスのcontrollerに飛ぶにはどうすればいいのでしょうか。
topView.swift
swift
1button.addTarget(self, action: #selector(topViewController.saveValue), for: .touchUpInside)
topViewController
swift
1 @objc func saveValue(sender:UIButton){ 2 print("tap") 3 4 let score = sender.tag 5 print(score) 6 }
値を渡したいのですがappdelegateにThread 1: signal SIGABRTというエラーが出ます。
どうしたらうまく接続できるのでしょうか。よろしくお願いします。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。