Added Support for System Weighted Fonts#301
Conversation
|
Failed the test due to #302. |
|
@timbodeit please review this pull request. @tombenner please take a look. |
There was a problem hiding this comment.
Just something that came to my mind (wouldn't make any effort to change it):
Adding this check to the last else block would require less nesting
|
Looks good to me. I'd wait a bit to give @tombenner some time to veto, but after that it's good to merge 👍 |
|
LGTM 👍 |
Added Support for System Weighted Fonts
|
@Stunner Please have a look at the CI failures |
|
I am not able to reproduce this issue locally. Running the test target from iOS 7.1 (Xcode 6.4) , 8.1, 8.2, 8.3 (Xcode 7.1) all works for me. It appears it is complaining of a compilation error of a class method on UIFont. I am thinking it is due to an early version of Xcode running on the CI server. Can someone with access to the Travis CI for this project investigate further ( @tombenner )? |
|
You have full access to Travis CI for the project. The problem is that The compile error will only happen, if you're using an iOS SDK older than 8.2. If you're using a newer SDK, this will probably (not tested) still cause issues, but rather in the form of a runtime crash than a compile time error. The reason why you're not able to reproduce this issue on your machine is that Xcode 6.4 uses the I'm not entirely sure yet how to properly fix this, but I think we're going to need two additional checks:
I'm going to do some research on what the best way to handle this is. In the meantime, it would be awesome if you could add test coverage for the changes you made, to make sure they actually work as expected at runtime. Also it would be a good idea to run the tests against multiple iOS versions on Travis. I'll probably take care of that in the next couple of days. |
|
So to fix this, replace if ([[UIFont class] respondsToSelector:@selector(systemFontOfSize:weight:)]) {
/* ... */
}(iOS 7.0 device version run time only check) by #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_8_2
if (&UIFontWeightBlack != NULL) {
/* ... */
}
#endif(iOS 8.2 SDK compile time and iOS 8.2 device version run time time check) Nonetheless, if you'd be willing to add one, a unit test can't hurt 😉 The first line will check that the base SDK version is at least More info about this on stackoverflow and in Apple's SDK Compatibility Guide. |
|
I have reset master to the commit before merging your pull request, leaving the previous state in a new branch named |
|
@timbodeit Cool deal, thanks for the info and suggestions. Followed your suggestions and just issued a pull request: #311 assigned it to you to review and merge in. |
No description provided.