Swiftをバリバリ書いてるマスタカです
今まではObjective-cからSwiftを呼んでいたのですが
今回は逆でSwiftからObjective-cを呼んでみた
・現象
ObjectivecViewControllerの中で
Swiftのprotocolやらclassを利用してる
今回Swiftから参照できるようにProjectName-Bridging-Header.hに以下を書いた
#import "ObjectivecViewController.h"
・エラー
この状態で以下のエラーが出た
Cannot find protocol declaration for ‘SwiftDelegate’
Unknown type name ‘SwiftClass’
・解決策
循環参照になってるのでObjectivecViewController.hに以下を記載する
@protocol SwiftDelegate; @class SwiftClass;
この辺知らないことが多いので辛いです
All Swiftになれば解決なんだがなぁ・・・