Closed zdnk closed 8 years ago
The problem with that is, and the reason why I went with simple enums in most of these cases is, that corners and edges have specific configurations that make sense, and ones that don't make any sense. If you were to pass in [.Bottom]
to anchorInCorner()
, that wouldn't be enough information to do anything, and would require checking a number of invalid combinations and subsequent error handling and more complicated documentation. Passing in [.Bottom, .Left]
to anchorToEdge()
doesn't "make sense" either, so I still feel the current configuration is easier/clearer to implement and use.
I see, you are probably right. It actually also provides build time check everything is all right.
Right now:
could be:
Example of bitmask/option sets/flags in Swift 2.0: