OC and Swift Tutorial

Source: Internet
Author: User

A day of learning swift, and after it was mixed with OC, I suddenly felt the language was fine.
The following is a brief talk about its pointers


1. Create a swift or OC project: I am here to create the Swift language project, project name Swifttest


2, in the Project code directory to create a OC class, select the OC Language, a dialog box, select Yes



3, this will be in the project to see such a header file


4. Add the. h file of your OC file in this header file, and you can invoke the included OC file yourself in any swift file.


5, next in the project target-"build setting->package under the personality of the following two items



6, and then in the OC Code of the. m file to introduce the + "-swift.h" Such a header file, such as my project will generate swifttest-swift.h such a header file. Then your. m file will be able to invoke swift files casually.



In fact, if you set the defines Module = yes, Xcode will default to the product Module name-swift.h, a header file that will have the. h information for all your. Swift files under this header file. That's why you know everything.

OC and Swift Tutorial

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.