Drawing Text over NSImage

I have the following code to draw a text over an NSImage. But the resulting image is getting cropped at the corner and only the corner portion is displayed. What i’m i doing wrong? Please advice funcdrawText(image :NSImage) ->NSImage {     let text = “sample…

How to test WKWebview

Now I’m writing the unit tests. There is a problem to test the WKWebView. Do you know how to execute the navigationDelegate methods. I have tried like this, but it crashed. Could you please help me? Thanks in advance.         let wkNavigation = WKNavigation()         let error…

Objective-c output parameter in Swift

The Objective-C function in the Pinterest API is defined as:   (void)getAuthenticatedUserBoardsWithFields: (NSSet *)fields success:(PDKClientSuccess)successBlock andFailure:(PDKClientFailure)failureBlock;   fields is an output parameter that will be populated by the function.   This is how I invoke the function in Swift, having already created a bridge file,…

Enums: “Syntactical-Sugar”

Learning Swift right now I am up to Enums and realise that Syntactical-Sugar (simplification) was always going to be something that Apple would like to do, as they did with scrollbars.   While removing type names may be cool, and it is readable, it’s seems…