Swift is determined whether there is a string expression Emoji

Update:The network spread emoji Code pointNot complete,I follow Wikipedia-refresh a bit,The paper version of the code was updated Swift。

Many times we need to determine a character、Or that there is not a word that contains the emoji,Use Swift language development app is no exception,For example, you can use a regular expression - but unfortunately,It seems different languages[……]

Click link to continue reading...

A quick look at the string

Most of the time,We need to look at many strings,To determine the specific content filtering out。For example, through the input method which pocketed,We need to use auxiliary code word to filter out candidates need。

In General,Find and Compare certainly figures to fastest,However, in the lexicon we can not put all the words are converted to digital (although theoretically feasible ......) search on the string,We realize there are many ways to,Here, I say my own ideas[……]

Click link to continue reading...

Memory Problems swift hurricane

Swift language development in the use of time,Many of my friends will be baffling problem encountered memory full,Obviously there ARC ,Obviously the release of memory,But still let the program memory footprint with circulation soared。

There is not really a memory leak occurs,This is actually ARC A mechanism:In each of the main Runloop At the end of the clean-up。That is,It is necessary to have a cache[……]

Click link to continue reading...

SourceKitService take up a lot of memory and CPU solutions

Swift performed using Xcode development software language when,Many people in the latter part of the project will encounter such a problem,If that diagram as:SourceKitService Take up a lot of CPU and memory,Or even directly cause the system stuck。

Then,This in the end is how it all about? StuckOverflow of the vote on the answer is to say:[……]

Click link to continue reading...

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

Use SQLite database in Swift Lane


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

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

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 is a stateless and lightweight[……]

Click link to continue reading...