I'm teaching myself to program using the book Swift for Beginners: Develop and Design. In one lesson I get the error message, "expected identifier in function declaration". The version of Xcode I'm using is more recent than the one the book was written for and I'm having some difficulty figuring out what the error is. Any help would be appreciated.
By the way, the code the book had me enter is,
extension Int {
func repeat(work: () -> ()) {
for _ in 0..<self {
work()
}
}
}
repeat {(
print("repeat this string")
)}