Decorators in Swift
<p>I'm new to Swift, and I'd like to know if the language has some equivalent to Python's decorator pattern.<br>For example:</p>

<pre><code>import functools


def announce(func):
    """Print a function's arguments and return value as it's called."""
    @functools.wraps(func)
    def announced_func(*args, **kwargs):
        rv = func(*args, **kwargs)
        print('In: {0}, {1}'.format(args, kwargs))
        print('Out: {}'.format(rv))
        return rv
    return announced_func


@announce  # add = announce(add)
def add(a, b):
    return a + b

add(2, 5)
# In: (2, 5), {}
# Out: 7
# 7
</code></pre>

<p>Perhaps I just haven't found it yet, but Swift doesn't seem to have a way to forward arbitrary arguments to functions or to preserve a wrapped function's information (as functools.wraps does).<br><br>Is there an equivalent, or is the pattern not meant to be used in Swift?</p>