我有这个框架 XXUIKit.framework
在里面我有一个定义为 XXConfigurable.swift
@objc(XXUIConfigurable)
protocol XXUIConfigurable {
func configureItem(indexPath: NSIndexPath, data:AnyObject);
}
框架内部的类可以很好地找到这个协议(protocol)。就在我尝试在框架之外使用它时:
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
关于ios - swift 自定义 .framework 找不到协议(protocol),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32449547/