我尝试使用RxSwift作为依赖项创建一个名为MyLib
的库,它使用cocoapod命令pod lib create
。但是,以下代码不起作用。
import UIKit
import MyLib
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// compile error: Use of unresolved identifier 'Observable'
Observable.just("")
}
}
它只在我添加import RxSwift
后才有效
我想只导入MyLib
,有任何想法吗?
谢谢!
Observable
不是你的类,所以关于RxSwift开发人员,建议使用这个导入。
但是如果你真的想要在你的库中尝试使用qalxswpoi的typealias吗?
例如:Observable