updated Swift sample after latest language changes