Bridging file between OC and Swift (PROJECTNMAE-BRIDGING-HEADER.H) (projectnmae-swift.h)

Source: Internet
Author: User

OC and Swift are 2 in different languages, OC code can only be written with OC files, Swift code can only be written in Swift file, although 2 different languages, but can call each other, but need to do a bridge, is the following 2 files

(Projectnmae-bridging-header.h)

Swift file to invoke OC code you will find that you can not reference the Oc.h file, so you need to use this file, the OC file to bridge, some oc.h files are referenced here, and then you can operate in the Swift file OC code

(projectnmae-swift.h)

OC calls the SWIFT code to refer to this file in the OC file, and you will find that the file is not in your project because it is a hidden file.

If your project is a Oc/swift project, the first time you create a Swift/oc file, you will be prompted with the following

This file will automatically create a (projectnmae-swift.h)/(projectnmae-bridging-header.h) file when you finish clicking it

Bridging file between OC and Swift (PROJECTNMAE-BRIDGING-HEADER.H) (projectnmae-swift.h)

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.