I have this problem when I try to add print() in my override func. What should I do to avoid this?

I tried to add some return but nothing happens.
>Solution :
You need a return statement in the overridden function.
You can store the result of the call to super in a variable, do the print, then return the variable.
override func sum(_ first: Float, _ second: Float) -> Float {
let result = super.sum(first, second)
print("Message here")
return result
}
Or you can print first and directly return the call to super:
override func sum(_ first: Float, _ second: Float) -> Float {
print("Message here")
return super.sum(first, second)
}