ios - swift 自定义 .framework 找不到协议(protocol)

标签 ios xcode swift frameworks

我有这个框架 XXUIKit.framework 在里面我有一个定义为 XXConfigurable.swift

的协议(protocol)
@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/

相关文章:

java - 将 .pem 文件转换为 .p12 以在 ios 中推送通知

ios - 库缓存路径中 iOS 应用程序 Cache.db 的用途是什么?

iphone - 在 UIGraphics 上下文中绘制矩形不起作用

ios - Sinch:如何在 Swift 中设置 SINCall 变量?

ios - 计时器在真正的 iPhone 上不工作

ios - 我如何快速发现我的字符串包含阿拉伯字符(英语或数字除外)

ios - UIApplicationOpenSettingsURLString 在 iOS 10 中不起作用

Xcode 文件系统

objective-c - 在 iOS 中没有报摊的应用程序处于非事件状态时在后台下载文件

ios - 以编程方式添加前导/顶部约束