나는 뭔가가 정말로 명백하게 틀렸다고 생각한다. 그래서 내가 조금 두껍다면 나를 용서해라.함수에 전달 된 클로저를 호출하는 방법은 무엇입니까?
클로저에 대한 모든 예제는 클로저를 배열 맵 함수에 전달하기위한 것입니다. 나는
이것은 내가 도와주세요 잘못
을 뭐하는 거지에
func closureExample(numberToMultiply : Int, myClosure : (multiply : Int) -> Int) -> Int
{
// This gets a compiler error because it says myClosure is not an Int
// I was expecting this to do was to invoke myClosure and return an Int which
// would get multiplied by the numberToMultiply variable and then returned
return numberToMultiply * myClosure
}
내가 완전히 난처한 상황에 빠진을 시도하고있는 무슨이다 클로저를 취 내 자신의 함수를 작성하려면!
try'return numberToMultiply * myClosure (1)' – Jack