Hello!
Encountered a potential bug in iOS 14 but wanted to cross-check here before creating a feedback on Feedback Assistant.
I have a mixed ObjC/Swift project, with the majority of ViewControllers currently written in ObjC.
There are a few extensions/categories in Swift/ObjC that add convenience methods to various UI elements, such as UIButton.
One such extension on UIButton looks like this:
Now, I'm not sure if this somehow shadows a (upcoming?) method on UIButton, but this worked on iOS 13.
Calling this method, both from Swift or Objective-C, however does not set the title on iOS 14. It stays blank/on the default.
If I set a breakpoint inside that setTitle() method, it won't get hit either.
Removing the @objc from the method seems to fix the issue (for Swift-based VCs), but makes it impossible to call from Objective-C.
Moving the @objc to the top of the extension doesn't help either.
Is this a regression, or am I missing something? Would appreciate everyone's advice here.
If it is a bug I will of course file a feedback on Feedback Assistant and link it here.
Encountered a potential bug in iOS 14 but wanted to cross-check here before creating a feedback on Feedback Assistant.
I have a mixed ObjC/Swift project, with the majority of ViewControllers currently written in ObjC.
There are a few extensions/categories in Swift/ObjC that add convenience methods to various UI elements, such as UIButton.
One such extension on UIButton looks like this:
Code Block swift extension UIButton { @objc func setTitle(_ title: String?) { self.setTitle(title, for: .normal) self.setTitle(title, for: .highlighted) self.setTitle(title, for: .selected) } }
Now, I'm not sure if this somehow shadows a (upcoming?) method on UIButton, but this worked on iOS 13.
Calling this method, both from Swift or Objective-C, however does not set the title on iOS 14. It stays blank/on the default.
If I set a breakpoint inside that setTitle() method, it won't get hit either.
Removing the @objc from the method seems to fix the issue (for Swift-based VCs), but makes it impossible to call from Objective-C.
Moving the @objc to the top of the extension doesn't help either.
Is this a regression, or am I missing something? Would appreciate everyone's advice here.
If it is a bug I will of course file a feedback on Feedback Assistant and link it here.