update Swift typecasting