In a UIView subclass, I'm override BecomeFirstResponder (which returns a Bool. 
class MyViewSubclass:UIView {
 ...
    override func becomeFirstResponder() -> Bool {
        // some stuff
        return super.becomeFirstResponder()
    }
 ...
}
When calling this method on a object of the subclass, I get a warning Result of call to 'becomeFirstResponder()' is Unused. 
This message doesn't not happened when I don't override becomeFirstResponder. 
I know that with Swift 3 the behaviour of methods returning results has evolved (see @discardableResult on SE-0047) but I would expect an override to have the same behaviour as its super method. 
Am I wrong for thinking that or is it maybe a compiler bug ?
Edit: 
FYI, I filed a bug for this.
I am not sure if it is bug. If you have override a function, then it could totally be possible that the return value now cannot be ignored. I would simply add @discardableResult if that's what you want: 
@discardableResult override open func becomeFirstResponder() -> Bool {
    // some stuff
    return super.becomeFirstResponder()
}
This may be the right way, even tho im not expert on swift, but from Objective-C
class MyViewSubclass:UIView {
 ...
    override func becomeFirstResponder() -> Bool {
        // some stuff
        super.becomeFirstResponder()
     return true
    }
 ...
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With