Swift code completed