Swift

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

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-67684720dd647177488[……]

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...

"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...

Xcode meanings in various Sent Event

In Xcode,We give iOS platform App,Will inevitably have to add a button to bind an event,At this time there is a statement,You will find a button touch event already not before a "Touch Up Inside" so simple。

Referring to FIG title,There are at least not so much in some events can be for your choice,In more features at the same time,Novices may be more ignorant of the force?[……]

Click link to continue reading...

Swift in the single mode

In the process of writing the code,We will meet when the need to ensure that only one instance of the global,This time use the singleton pattern。

Single mode--this ensures that only one instance of a class,And provide a global point of access to。

What about how to implement the singleton pattern? We take a look at the classic Java code,How to implement the singleton pattern。

We had a quick search on the Internet "java singleton pattern" will be able to find[……]

Click link to continue reading...

Strongly typed programming language、Weakly typed

in most cases,People use the programming language is implicitly convert data types to determine whether a languageWeakly typedLanguage,For example, C。

In fact,For in addition to the more classic foreign language,Most other common languages ​​Strong、Weak type could not tell - or,yesInconsistentof。So it will always be someone to argue。If we take as the basis for the concept of opening,Then the conflicts will appear:

比如 Pasc[……]

Click link to continue reading...

Swift sent through HTTP JSON-RPC command

While our Web development,Would inevitably have to obtain data from the Web server,In many cases also need to submit the data to the server,Which at the moment,We are used to using JSON formatted data,Because it is easy,This time we look,How to use Swift to send JSON-RPC command and get response。

JSON-RPC

JSON-RPC is a stateless and lightweight[……]

Click link to continue reading...