swift 自定义 .framework 找不到协议
swift custom .framework cannot find protocol
我有这个框架XXUIKit.framework
,其中我有一个定义为XXConfigurable.swift
的协议
@objc(XXUIConfigurable)
protocol XXUIConfigurable {
func configureItem(indexPath: NSIndexPath, data:AnyObject);
}
框架内部的类可以找到这个协议就好了。就在我试图在框架之外使用它的时候:
import XXUIKit
...
func collectionView(collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, atIndexPath indexPath: NSIndexPath) -> UICollectionReusableView {
let header = collectionView.dequeueReusableSupplementaryViewOfKind(kind, withReuseIdentifier: sections[indexPath.row].cell, forIndexPath: indexPath) as? XXUIConfigurable
return header
}
找不到类型:
error: use of undeclared type 'XXUIConfigurable'
主应用程序可以从 XXUIKIt.framework
.
中查找和使用其他 类
唉,抱歉,但我解决了。
public protocol XXUIConfigurable
我有这个框架XXUIKit.framework
,其中我有一个定义为XXConfigurable.swift
@objc(XXUIConfigurable)
protocol XXUIConfigurable {
func configureItem(indexPath: NSIndexPath, data:AnyObject);
}
框架内部的类可以找到这个协议就好了。就在我试图在框架之外使用它的时候:
import XXUIKit
...
func collectionView(collectionView: UICollectionView, viewForSupplementaryElementOfKind kind: String, atIndexPath indexPath: NSIndexPath) -> UICollectionReusableView {
let header = collectionView.dequeueReusableSupplementaryViewOfKind(kind, withReuseIdentifier: sections[indexPath.row].cell, forIndexPath: indexPath) as? XXUIConfigurable
return header
}
找不到类型:
error: use of undeclared type 'XXUIConfigurable'
主应用程序可以从 XXUIKIt.framework
.
唉,抱歉,但我解决了。
public protocol XXUIConfigurable