3 ms·
> These wrappers can cause issues, and as they’re written in Swift, there aren’t many possibilities to fix issues from the outside (unlike with swizzling in the
by Wowfunhappy 6y ago
> These wrappers can cause issues, and as they’re written in Swift, there aren’t many possibilities to fix issues from the outside (unlike with swizzling in the earlier days).
I assume based on this Swift code can't be swizzled for some reason?
- monocularvision 6y agoSwizzling uses the Objective-C runtime, which in turns handles the message passing mechanism. Unless you inherit from an NSObject, you can’t swizzle in Swift.
- favorited 6y agoUnless you're building something on your own, in which case there is an (unoffically supported) attribute which you can use to opt-in to swizzling of methods. The difference being you have to opt-in, so you can't swizzle someone else's methods (unless they let you). https://twitter.com/jckarter/status/1135730593537249282?lang=en https://twitter.com/jckarter/status/1135730593537249282?lang...
- andrekandre 6y agoand even then, youll have to mark your properties and functions @objc / dynamic to allow that to work with messaging