I am new to swift and I was following an open source tutorial to learn Swift, however one error keeps cropping up - "Editor placeholder in source code" This is the code:
func setupGameLogic (){
for index in 0 ... fields.count - 1{
let gestureRecogniser = UITapGestureRecognizer(target: self, action: Selector("fieldTapped:"))
gestureRecogniser.numberOfTapsRequired = 1
fields[index].addGestureRecognizer(gestureRecognizer: UIGestureRecognizer) //Editor placeholder in source file
}
}
This code is wrong:
fields[index].addGestureRecognizer(gestureRecognizer: UIGestureRecognizer)
When you are calling a method, you supply an argument value: you do not supply a type describing the required parameters. You want to say this:
fields[index].addGestureRecognizer(gestureRecognizer)
An editor placeholder is a solid rounded rectangle with text in it, inserted through code completion. It might look like this:
or this:
You need to look for that sort of thing in your code and replace it with actual text (or delete it).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.