ashfurrow / Forgeries

Helper methods for testing iOS code
MIT License
83 stars 6 forks source link

Protocol Extension #16

Closed ashfurrow closed 8 years ago

ashfurrow commented 8 years ago

Instead of using C macros, which are terrible, and adding a category for every class that conforms to UITraitEnvironment, we ought to just use a Swift protocol extension. A friend sent in an example that replicates our existing functionality: https://gist.github.com/asmallteapot/cf91cca4fe692932fac9

This would be way better. The only reason I didn't use this approach is because I tried but Xcode fought back, so I went with C macros (sometimes easier than fighting with Xcode!). But this is better.

orta commented 8 years ago

Don't think it's worth rushing to add swift code unless it really does add something useful, we're limiting the consumers of the library to people using frameworks then.

ashfurrow commented 8 years ago

Makes sense.