Home > Web Front-end > JS Tutorial > body text

How to set up debug with swift

php中世界最好的语言
Release: 2018-03-13 09:28:36
Original
1464 people have browsed it

This time I will show you how to set up debug with swift, and what are the precautions for setting up debug with swift. The following is a practical case, let's take a look.

In OC, you can set #if DEBUG #else #endif to distinguish the formal environment and the test environment

#if DEBUG

... Simulation data

#else

... Real data

#endif

But there is no default tag in swift, so the above writing method does not work. But it can be passed Manually set it yourself to achieve the effect of OC. The specific steps are as follows:

In Build setting >>>

Search swift fl >>> Find Other Swift Flags and Expand>>> Find Debug and click the "+" sign>>>Write -D DEBUG in the input box (where -D is the fixed mode and the DEBUG after it can be customized)

How to set up debug with swift


Set DEBUG flag

Called in swift the same as OC

#if DEBUG


... Simulated data

#else

... Real data

#endif

I believe you have read the case in this article You have mastered the method. For more exciting information, please pay attention to php Chinese website

Other related articles!

Recommended reading:

How to add a code block with prompt function

Commonly used WebStorm shortcut keys

Regular expression to verify domestic mobile phone number and landline number

The above is the detailed content of How to set up debug with swift. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!