Hi @eskimo,
I like reading this:
I was intrigued by your question because I often end up using low-level APIs that have C callbacks.
because then you may have already the solution
The post you suggested doesnt seem to work for my case though:
public class glfw {
typealias ErrorFun = (Error, _ description: String) -> Void
static func setErrorCallback(cbFun: ErrorFun) {
withUnsafePointer(to: &self) { // error: cannot pass immutable value as inout argument: 'self' is immutable
..
}
}
}
No problem, I'll be more than happy to summarize it for you:
wrapping Swift capturing Closures around C Callbacks, which have no context parameter.