###前提・実現したいこと
某オンラインスクールの学習の中でやっているのですが、エラーが複数出て、ググっても微妙に違う回答が出るばかりで、さっぱり分かりません。
###発生している問題・エラーメッセージ
エラーメッセージ Expected '}' in class Method does not override any method from its superclass cannot assign value of type 'Int' to type 'String' Only instance methods can be declared `IBAction cannot assign value of type 'Int' to type 'String' cannot assign value of type 'Int' to type 'String' cannot assign value of type 'Int' to type 'String' cannot assign value of type 'Int' to type 'String' ###該当のソースコード // // ViewController.swift // Swiftimageview // // Created by user on 2017/06/24. // Copyright © 2017年 sa. All rights reserved. // import UIKit class ViewController: UIViewController { @IBOutlet var backImageView : UIImageView! var count = "0" override func vieDidLoad() { super.viewDidLoad() count = 1 @IBAction func change(_ sender:AnyObject){ if (count = 0) { backImageView.image = UIImage(named: "back1.jpg") count = 1 } else if (count = 1){ backImageView.image = UIImage(named: "back2.jpg") count = 0 }} } ![イメージ説明](68478984811d76b26bb2b95a59abaf65.png) ###試したこと 検索 ###補足情報(言語/FW/ツール等のバージョンなど) xcode8.1 swift3
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。