Using the swift third-party framework in OC Code

Source: Internet
Author: User

Swift is now using more and more, and some of the mainstream frameworks or better-performing demos have been written using Swift. So, learn how to invoke Swift in an OC project.

The main use of a bridge file, this bridge file usually when you import Swift code or create Swift code will ask you whether to create, this time to choose to create, and then you can introduce a bridge file in the OC project, so that you can create swift objects, using their corresponding methods.

But there may be a situation where the Swift proxy method cannot be called in OC, the following two learning materials have a more detailed introduction to this piece, you can learn.

Reference: Hybrid programming for Ios-swift and OBJECT-C

Unable to invoke Swift Proxy method workaround in OC: Call to Swift's proxy in OC

Finally, I wrote a small demo of my own:

Demo:ocplayswift (Extract code: 4734)

Using the swift third-party framework in OC Code

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.