ClassyKit / Classy

Expressive, flexible, and powerful stylesheets for UIView and friends.
http://classykit.github.io/Classy/
MIT License
740 stars 76 forks source link

Caching, styling per window, load on demand, system font support + tests #111

Closed mikeger closed 8 years ago

mikeger commented 8 years ago

Hey We are having some updates for Classy, based on our most recent usage experience:

Also contains tests for some of this functionality. Sorry for such a big PR.

mikeger commented 7 years ago

@dnedrow it's really nice to hear that someone is using Classy in production!

Sorry for that change sneaking in, since the PR is from master to master it also included all other changes.

bootStrapClassy is useful when

  1. Your app sometimes does not need to load classy, for example when the app is started from the push notification on the background.
  2. Classy needs to know the full list of windows in the application, if you have more than one.

Real-life use example can be found here: https://github.com/wireapp/wire-ios/blob/75f558d483324946ec846a7b600fef39db8fb09f/Wire-iOS/Sources/AppRootViewController.swift

dnedrow commented 7 years ago

@mikeger cool, thanks. So calling bootstrapClassy as below should be an acceptable setup if there is no need for special window handling?

    [CASStyler bootstrapClassyWithTargetWindows:UIApplication.sharedApplication.windows];
mikeger commented 7 years ago

Yes, if (1) code is not executed in the app extension (then there is no UIApplication) and (2) all your windows are loaded.