我的代码类似于下面的代码片段
class MainViewController: UIViewController {
private var bLogin = true
}
如何从 XCTest 文件访问“bLogin”变量?
谢谢
最佳答案
如果您使用的是 Swift 2.0,请将 @testable
添加到导入语句中:
@testable import MyMainModule
关于ios - Swift XCTest 访问私有(private)变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32124920/