swift pass any closer to the function

106

func anyFunc<T>(_ closure: @autoclosure () -> T) {
  let result: T = closure()
  // TODO: Do something with result?
}

anyFunc(print("hello"))

Comments

Submit
0 Comments