I wrote Attributed to make attributed strings in Foundation more expressive. It works well with many attributes, including fonts and colors, because those values are represented by a single simple object. However, the paragraph style attribute contains a number of different properties. By default, the best way to create a paragraph style is to create a mutable version and set its properties. As this requires multiple expressions, it can’t be used inline with other attribute functions, without embedding it within a closure, which is also unnecessarily verbose.
To solve this, I’ve written a simple extension function for NSParagraphStyle, called with. It takes all of the properties that can be set on a mutable paragraph style as parameters, all of which have default values, so only the necessary properties need to be specified, like so:
Shirley is a minimal request framework for Swift programs. It uses ReactiveCocoa signal producers as a unified method for asynchronous data delivery, instead of callback functions. This allows disparate responses to be unified, with a single stream-based system.
The central type of the framework is a session, represented by the SessionType protocol. Session is a closure-based implementation, which can also be used for type erasure.