My Swift code looks like this:
class SystemClass {
public init() {}
func setXYZ(xyz: Float32) {
// do something
}
}
let callME: class = class()
class class {
public init() {}
func functionXYZ() {
Timer.scheduledTimer(timeInterval: 0.5, target: self, selector: #selector(SystemClass().setXYZ(xyz: 1.0)), userInfo: nil, repeats: true) // error code
}
}
callME.functionXYZ()
I'd like to call the 'functionXYZ
' and this is already working fine but calling the setXYZ
function leads to errors because the selector failed.
How to edit the selector:
#selector(SystemClass().setXYZ(xyz: 1.0))
to call the setXYZ
function with the given parameter?