I am using XCode 7.1 Beta to develop an app in Swift 2.0. I am trying to access a few classes in the app (e.g. AppDelegate) from the UI Test class. I have enabled testability in the build settings for the app and added this line in the test class:
@testable import MyApp
I am accessing the AppDelegate like this:
override func tearDown() {
super.tearDown()
let delegate : AppDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
delegate.myFunc()
}
However, I am running into a linker error:
Undefined symbols for architecture x86_64:
"type metadata accessor for MyApp.AppDelegate", referenced from:
MyAppUITests.MyAppUITest.tearDown (MyAppUITests.MyAppBasicUITest)() -> () in MyAppBasicUITest.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Same error when I access any other class in the app. Any idea how to access classes in the app from the test app ? Is it supported ?