News for hackers. Stuff that matters.
Re:Apple’s Use of Swift in iOS 13 by regera on Thursday September 26, 2019 @03:26PM (#21084530)
Pure Swift for the new apps. We freak out when we see @ObjC or NSObject usage in our codebase. On a long enough timescale when Apple converts away from using Objective-C under the covers, our code will not need any modification.
Re:Apple’s Use of Swift in iOS 13 by saagarjha on Thursday September 26, 2019 @04:16PM (#21085046)
> We freak out when we see @ObjC or NSObject usage in our codebase.

…how are you interacting with UIKit?!

Re:Apple’s Use of Swift in iOS 13 by favorited on Thursday September 26, 2019 @04:24PM (#21085115)
You rarely have to add @objc annotations or use NSObject directly. You only need it for target/action, KVO, etc.

I rarely see that annotation or class name in my codebases too.

Re:Apple’s Use of Swift in iOS 13 by dep_b on Thursday September 26, 2019 @04:59PM (#21085480)
UIButton only? Maybe binding UITextField events?
Re:Apple’s Use of Swift in iOS 13 by favorited on Thursday September 26, 2019 @05:30PM (#21085766)
Buttons, selector-based Notifications (though the block version is finally good, so we mostly just use that now), & gesture recognizers look like our biggest users of @objc. Basically all to support target/action.

A quick search through one of my apps shows that about 4% of functions are marked as @objc (and we're not using the old compatibility mode where more methods were implicitly @objc either).

Re:Apple’s Use of Swift in iOS 13 by regera on Friday September 27, 2019 @04:52PM (#21096167)
@IBAction can replace @ObjC for all selectors. We put it a mandate in our code reviews. There is also NSObjectProtocol which forces (in most cases) devs to subclass NSObject.