Differences between OC and Swift 1. Differences between OCSwift

Source: Internet
Author: User

Differences between OC and Swift 1. Differences between OCSwift

1. File suffix

File Suffix of oc: header file. h main file. m

The suffix of the swift file is. swift.

2. Code Separator

Use semicolons in oc; as the Code Separator

In swift, you do not need to use code delimiters to separate lines of code. If there are multiple lines of code in a line, separate lines of code using semicolons.

3. main Function

The main function of oc is the program entry, and its function definition is similar to that of C language.

Swift does not have the main function, and its code runs first. The first line of code is the program entry.

 

Related Article

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.