Swift Demining (i)

Source: Internet
Author: User

In the objective-c, in order to make the code organized by the convenient use of Control+6 shortcut keys in Xcode to find, so there is a lot of people are familiar with the east. This is:#prama Mark.

#pragma mark

But what does this thing correspond to in Swift?

First a lot of simple, no need to write so many letters ... These landmark are //mark: (= = #pragma),//todo:,//fixme.

These landmark can already be used in the xcode6.0.1.

Objective-c's #warning in Swift does not have a standard corresponding landmark, which is generally replaced by the global function fatalerror .

A fatal error occurred and program execution should stop in debug,///optimized and unchecked modes. @noreturn func fat Alerror (message:staticstring, file:staticstring = default, Line:uword = default)

Call this function FatalError ("Method not Implemented")in a method that the subclass must implement. where the fatalerror method is used, the compilation can be done. But in the run time will be error!

Swift Demining (i)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.