Re: [swift-users] Callback in Swift

2017-01-25 Thread Rien via swift-users
> On 25 Jan 2017, at 10:33, John Brownie wrote: > > Thanks, that does it for me, though I had to qualify the Unmanaged with a > type in the first part. > > Rien wrote: >> For the context I passed in: >> >> UnsafeMutableRawPointer(Unmanaged.passUnretained(self).toOpaque()) >> >> And to get t

Re: [swift-users] Callback in Swift

2017-01-25 Thread Quinn "The Eskimo!" via swift-users
On 25 Jan 2017, at 07:49, John Brownie via swift-users wrote: > My macOS app shows a representation of the contents of various folders, so > using FSEvents to track modifications from outside the app seemed to be the > way to go. I am running into difficulty with writing the code with a > ca

Re: [swift-users] Callback in Swift

2017-01-25 Thread John Brownie via swift-users
Thanks, that does it for me, though I had to qualify the Unmanaged with a type in the first part. Rien wrote: For the context I passed in: UnsafeMutableRawPointer(Unmanaged.passUnretained(self).toOpaque()) And to get the context back inside the callback: let ourself = Unmanaged< … your type

[swift-users] Callback in Swift

2017-01-24 Thread John Brownie via swift-users
My macOS app shows a representation of the contents of various folders, so using FSEvents to track modifications from outside the app seemed to be the way to go. I am running into difficulty with writing the code with a callback, all in Swift. I must be doing something wrong, as I get a crash i