ksnowlv

回顾过去,总结以往;立足现在,铭记当下;技术为主,笔记而已.

Swift调用objective-c

| Comments

swift调用objective-c在混编开发时经常会使用。

一.项目设置

TARGETS –>Swift Compiler – General –>Objective-c Bridging Header 选项指定桥接文件,通常该文件命名为:工程名+Bridging-Header.h

如图所示 image

二.objective-c工程文件。

1.桥接文件

在桥接文件中需要包含需要引用的头文件 image

2.swift类中调用。

image

Comments

comments powered by Disqus
Included file 'custom/after_footer.html' not found in _includes directory