Make final Objective-C class in Swift

It is common practice to make Swift classes final, if inheritance is absolutely necessary, to encourage the use of composition instead. Swift applies this regardless of the final keyword when importing into Objective-C by setting the Objective-C objc_subclassing_restricted . However, interfaces with these attributes are not imported into Swift as final classes, as I expected.

How to create a Swift class that was imported from Objective-C final ?

+5
source share

Source: https://habr.com/ru/post/1238967/


All Articles