Let's say I have this code snipped in the playground
import UIKit
internal final class TestClass {
internal final var funcPointer: () -> Void
init() {
self.funcPointer = self.func1() //Cannot assign value of type '()' to type '() -> Void'
}
internal final func func1() {
print("func1 is called!")
}
}
var testClass: TestClass = TestClass()
testClass.funcPointer()
Why do I get the shown error message within the init() method and how to initialize a function pointer correctly?
I have already seen this SO post and this tutorial but anyway I don't get it to work for a (Void) -> Void function...