inversion of control swift