Swift

Apple's new place of OC for a high-level programming language!

How pocketed input method macOS is how to handle ascii 0x01 compatibility issues -macOS input settings correct buffer

As early as last year,Off the grid user input methods have reported pocketed Chinese input method macOS can not type in normal mode MarkDown proper way cloud notes,After testing proved true,Embodied in the text when hit,buffer refresh will be strange delete a character before the cursor - on,no more, no less,To delete a。

Fiddle for a long time failed,Finally, I did not move all the contents out of print,Find[……]

Click link to continue reading...

Pocketed input method is how to share anti-piracy accounts on iOS

For iOS developers,The face of app piracy,The biggest problem is not a technical break,Instead, more and more sharing of pirated Apple ID,Some people might say that piracy is equivalent to a "trial" of the,Like people will naturally go into positive ...... but in fact,Because of penny share account of piracy,Led to numerous independent developers and ultimately to the vote resume。

Anyway,last year,Surge author[……]

Click link to continue reading...

In NSView 10.12 Detailed problem does not show shadow

On iOS,If we want to display a shadow View,So basically do:

but,To the macOS,This would not work - no effect。

The answer lies in the macOS a View If you want to use [crayon-6767782[……]

Click link to continue reading...

macOS keyboard event intercepted three ways

Under normal circumstances,You do not need to know the contents。

In rare cases,Your app might need to get the user presses the button information,such asThe ones released Develop a Input Method。Only then can you provide candidates to the user。

How to create an input method under macOS,I'm hereSwift uses InputMethodKit to write an input methodThis article has detailed instructions,Here skip[……]

Click link to continue reading...

Analyzing a multi-monitor window position macOS

When developing pocketed input method,I met such a thing,That is, as a candidate bar window will go beyond the screen when the edge of the screen! and so,In the display window when I do extra check the coordinates:

Anyway,That is, if you count the coordinates of their width exceeds the width of the screen,Norway put it back。

but,Such[……]

Click link to continue reading...

How to make NSWindow displayed in a different Space or the Screen

Among write off the grid input method the Mac version of the process,I encountered such a problem,Article candidate system API disrepair,Many API functions exists but is essentially useless,such as:

This method is used to set the style of a candidate bar,In addition to the default inside[crayon-6767782c283931061[……]

Click link to continue reading...

URL encounter Chinese characters could not be initialized

In the Swift,We often used to initialize a URL path,For example, links to web pages。For example, this:

When the user clicks the button (for example, the Help button),Then all of a sudden will help the user to open the default browser,And opens the specified page (here's a forum)。

Then,If this is your link[……]

Click link to continue reading...

How pocketed the key input is to achieve sound

All to known,Input method does not need to get off the grid. "Full access rights”,So according to Apple's rights,Naturally, you can not play the key tone。

but,Recent pocketed updated input method added this feature - you can even join in later versionsKey shockGot it。However, I stillNo needGet "full access"。

Then,How I do it?

iOS in the sound and vibration

In fact, the same thing[……]

Click link to continue reading...