Programming Development

Swift uses InputMethodKit to write an input method

How to write an input method on iOS? This question has been answered a lot of people over。You can easily find a detailed tutorial by Google。but,On macOS write an input method is not so simple。

Ok,Strictly speaking,I mean use Swift to write a input method is difficult on macOS。The main reason is that no one has ever done this thing 。

Now able to[……]

Click link to continue reading...

Swift 3 GCD

Xcode 8 Official version has been released,I want the first time my project to the Swift 3 --After all, this is a trend。

During the migration process, I encountered a lot of problems--such as Xcode provides automated migration tool is not working,I've been waiting for more than two hours,after that I give up,I chose to manually migrate--after all,,Xcode's auto-correction is also very good。

however--[……]

Click link to continue reading...

Swift UIButton cornerRadius + shadow

Most of the time,We all want the button design style more in line with iOS,This will make the application interface does not look so jump,Even if the design does not look good,Nor was incompatible with the system。

"I'm not a designer,I don't know how to design beautiful style-but as close as possible to the system is not a wrong choice。 ” —— by Router

So it is for UIButton,Rounded corners + shadow should be the norm。[……]

Click link to continue reading...

iOS custom keyboard around the keyboard to move the cursor implement

Until we are,For example, third-party input method Sogou input method has a classic gesture - paddling around on the keyboard to move the cursor。And this feature I am also very common,so,I want to implement it yourself。

The first thing I think of is UISwipeGestureRecognizer ,However, with predictable results,Paddling can only move the cursor one space,This is not what I want[……]

Click link to continue reading...

Swift in regular expressions

At the beginning of a,Swift did not provide regular expression support,So we can only package,For example write a structure,Like this:

In fact, Swift already has support for regular expressions,We just need to:
[crayon-676c69cb0272a045611[……]

Click link to continue reading...

Swift set cut scores

in most cases,If we want to get the contents of a section of the array (for example, front-to-middle,Some of the values ​​of the array or the last),This time you need to traverse the array to assign a new array:

Such an array of short, better said it does not matter,However, if the array is relatively large and we need to value and more,It is clear that it is a waste of time to traverse up。[……]

Click link to continue reading...

Let go pip Agent

When using python,Often you need to download some third-party framework,Fortunately, python has a similar apt package management tool,pip。

but,Although management packs can pip,But no source switching mirror,And we downloaded package,Most of the large foreign code hosting server,This often leads to a few hundred KB of package to download one hour。

 [……]

Click link to continue reading...

"Plugin invalidated" ios Customize Keyboard

Home for iOS system does not seem to be willing to write an input method,Except for a few oligarchs other than large companies do nothing else。Approaching China's unique Apple ecological platform,Find inside are empty shells,Meaningful applications is really very little of。

Pocketed blog recently is working to write in the first paragraph can really support the iOS platform the code table of double input method,First compatible double nature of the programme is open to the "Chick double",[……]

Click link to continue reading...

Use SQLite database in Swift Lane

SQLite

Speaking SQLite,It is well known to you as MySQL,It is a relational database management system,But unlike the latter is that,It does not necessarily correspond completely independent server!

Generally speaking,SQLite is in the form of a file exist,Mostly used in embedded applications in storage。SQLite library is loaded by the application code,It can easily direct access to SQL[……]

Click link to continue reading...