- Read about dynamic dispatch and performance https://developer.apple.com/swift/blog/?id=27, Whether this will make big difference for you depends on whether you have WMO enabled etc.
- Configure Sourcery https://github.com/krzysztofzablocki/Sourcery
- Copy above
FindFinalClasses.swiftto your templates folder with.swiftemplateextension - Run Sourcery
chmod +x YourOutputFolder/FindFinalClasses.generated.swift- Run the file as executable
./YourOutputFolder/FindFinalClasses.generated.swift
All top level classes (not supporting nested ones for now) that aren't open or final already will become final.
should extension be
swifttemplateinstead ofswiftemplate?