Swift의 정적 함수 변수 스위프트의 함수에 대해서만 로컬 범위의 정적 변수를 선언하는 방법을 찾고 있습니다. C에서는 다음과 같이 보일 수 있습니다. int foo() { static int timesCalled = 0; ++timesCalled; return timesCalled; } Objective-C에서는 기본적으로 다음과 같습니다. - (NSInteger)foo { static NSInteger timesCalled = 0; ++timesCalled; return timesCalled; } 하지만 스위프트에서는 이런 일을 할 수 없을 것 같습니다.저는 다음과 같은 방법으로 변수를 선언하려고 했습니다. static var timesCalledA = 0 var static timesCalledB..