Updated swift snippet