前提・実現したいこと
「iPhoneアプリ開発集中講義」という本の2日目の2番の カメラアプリを作ろう「前半」という章をXcodeを使ってプログラムを書いていたのですが、UIパーツをプログラムに紐付けようとしても、下のようなエラーが出て紐づけることができません。
解決策を知っている人がいたら教えてください。(>人<;)
Only instance methods can be declared @IBAction
発生している問題・エラーメッセージ
Only instance methods can be declared @IBAction
該当のソースコード
@IBAction func SNSButtonAction(_ sender: Any) {
if let shareImage = pictureImage.image {
let shareItems = [shareImage] let controller = UIActivityViewController(activityItems: shareItems, applicationActivities: nil) controller.popoverPresentationController?.sourceView = view present(controller, animated: true, completion: nil) } }
試したこと
補足情報(FW/ツールのバージョンなど)
バージョン Xcode9.3
「iPhoneアプリ開発集中講義」という本の2日目の2番の カメラアプリを作ろう「前半」という章をやっている途中で起きました。エラーが起きたのは「ステップアップ」の途中です。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。