You can fend off UIFont dynamically only if the iOS version is less than 7.
What needs to be done to fix an unused method:
- Prepare your own replacement for an unused method.
- Check the OS version - "responsesToSelector:" is a great way to check it.
- Add an implementation if the method does not exist.
In UI7Kit, I fixed it with addClassMethodForSelector: ... which is provided by FoundationExtension.
See: https://github.com/youknowone/UI7Kit/commit/701c44a69406ad971794c9ab46aeb0cfac1fa207#L3R57
This code adds a new preferredFontForTextStyle: method from an existing implementation of the __preferredFontForTextStyle method:
In addition, UI7Kit is starting to support the method right now. (still very rude) Try it if you want.
source share