If you are in the migration process from Objective-C to Swift language, you maybe need to subclass some new Swift class back in objc. Today I will show you how you can do this and why you shouldn’t.
Let’s create our guinea pig class.
If you try to compile this code, you would be greeted by the “Cannot subclass a class with objc_subclassing_restricted attribute.” error. But wait, my class is not marked by any attribute! Or is it?
Let’s open the bridging header and find our class:
I’ve been fascinated by animations from the start of my software development career. When I started writing macOS applications using Cocoa, one of the first things I did was an animated button. Just an ordinary button. With some ripples when you click it. It looked like this: