@Claude31
Are you sure?
I've just ran it on a simulator device running iOS 13 and it works.. (on Xcode 12 beta).
This extension has been in the code base for a while now, probably 2-3 years, so I would be surprised if it hadn't worked on iOS 13.
Weirdly enough, if I stop app from Xcode and then reopen it on the simulator (without Cmd+R) the text shows up on an iOS 14 device too..
Post
Replies
Boosts
Views
Activity
Hmmm... There seems to be something that has changed between iOS 13.1 and iOS 13.5.
It works on iOS 13.1, but doesn't on iOS 13.5
I took a look.
It seems like this behaviour changed in iOS 13.4.
Calling the extension method unchanged works on iOS 13.0, 13.1, 13.2 and 13.3.
Running on 13.4 and 13.5 the same behaviour is observed as on iOS 14.
Something I've noticed though is that, if you terminate the app with the Stop button in Xcode and then restart the app by hand in the simulator (clicking its icon), the method works, both on iOS 13.4 and 13.5 and iOS 14.
So I'm not quite sure if this is really an OS issue, but rather an issue with Xcode or the Simulator?
I'll have to check next week, but yes. If you terminate the app and open it by hand in the simulator it works. Very weird behavior. I'll have to look into it further next week.
So I had another look this morning.
Running the app from Xcode 11.5 (11E608c) in an iPhone 11 iOS 13.4 simulator, the method in the extension is not called. However, if I terminate the app from Xcode (via the Stop button) and then relaunch it myself directly in the simulator the extension method is called.
The same happens with an iPhone 11 iOS 13.5 simulator. On an iPhone 11 iOS 13.3 simulator it works in either case, whether it is launched from Xcode or not.
I'll toss an example project on Github.
Thanks to @steipete on Twitter this seems to be resolved.
Since the category (or rather, its methods) are exposed to the Objective-C runtime with @objc, things can get a little hairy.
Seems like this started to clash with an internal method starting in iOS 13.4, and at that point the behaviour is undefined in the Objective-C runtime. So if you expose extensions/categories to the Objective-C runtime, it's still best practice to prefix them, like you are/were supposed to when writing Objective-C categories.