@IBOutlet weak var ImageView: UIImageView!
@IBOutlet weak var Button: UIButton!
Imagenames = ["#imageLiteral(resourceName: "image2")", "#imageLiteral(resourceName: "image1"]
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
@IBAction func Buttonpress(_ sender: UIButton) {
let imageV = Int(arc4random_uniform(2))
ImageView.image = UIImage(named: Imagenames[ImageView])
}
我該如何解決這個問題?請幫忙。運行最新版本的Xcode預期','分隔符當添加圖像
的
首先他*會*丟失a')'。其次缺少人物是一個密切的原因,而不是一個答案的理由。 – luk2302
而你的代碼仍然不能編譯,3個原因對於downvote來說已經足夠了。 – luk2302
@ luk2302非常感謝你 –