ashfurrow / UIView-BooleanAnimations

Perform changes to UI with or without animations, depending on a variable.
MIT License
47 stars 4 forks source link

shouldAnimate property on UIViewController #4

Open ashfurrow opened 9 years ago

ashfurrow commented 9 years ago

We could create a category on UIViewController that uses associated objects to store a boolean property, which defaults to YES if not set, that users of the library can use (we define this property on, like, all of our controllers anyway). We could even do something fancy with preprocessor macros on test targets to default to NO instead.

Thoughts @orta @1aurabrown ?

orta commented 9 years ago

Could make the ifs internally default to animated && (NSClassFromString(@"XCTest") != nil) thus dealing with the auto NO in tests.

ashfurrow commented 9 years ago

That'd be awesome! I was thinking of that, but the only thing I could thing of is seeing if the bundle name contains "Test", which isn't reliable. I like this a lot :+1:

orta commented 9 years ago

if you do this make a static var for fast lookups

1aurabrown commented 9 years ago

this would be cool, instead of having to set it to NO on every view controller instance in tests.