Re: Why are some Core Graphics APIs "hidden" from Swift?

2017-08-30 Thread Quincey Morris
On Aug 30, 2017, at 14:04 , Rick Mann wrote: > > But the X, Y versions have a double underscore: > >CGContext.__addArc(x1: CGFloat, y1: CGFloat, x2: CGFloat, y2: CGFloat, > radius: CGFloat) > > Why is this? I believe the double-underscore prefix indicates an Obj-C

Why are some Core Graphics APIs "hidden" from Swift?

2017-08-30 Thread Rick Mann
I notice the CGPoint version of APIs map to nice Swift method calls: CGContext.addArc(tangent1End: CGPoint, tangent2End: CGPoint, radius: CGFloat) But the X, Y versions have a double underscore: CGContext.__addArc(x1: CGFloat, y1: CGFloat, x2: CGFloat, y2: CGFloat, radius: CGFloat)

Re: NSDocument -canCloseDocumentWithDelegate::: not called when terminating

2017-08-30 Thread Jonathan Mitchell
> On 30 Aug 2017, at 18:30, Quincey Morris > wrote: > > On Aug 30, 2017, at 06:18 , Jonathan Mitchell > wrote: >> >> My documents have a lot of variable user cancellable activity that must run >> prior

Re: NSDocument -canCloseDocumentWithDelegate::: not called when terminating

2017-08-30 Thread Quincey Morris
On Aug 30, 2017, at 06:18 , Jonathan Mitchell wrote: > > My documents have a lot of variable user cancellable activity that must run > prior to document closure regardless of whether the document is dirty or not. > My solution is to run a termination preflight that

NSDocument -canCloseDocumentWithDelegate::: not called when terminating

2017-08-30 Thread Jonathan Mitchell
This is one from the archives: https://lists.apple.com/archives/cocoa-dev/2012/Jul/msg00740.html In short NSDocument -canCloseDocumentWithDelegate::: gets called on documents when closing the document window but only for dirty documents when closing the app via NSApp -terminate: (i.e.: the