Cannot access AppDelegate in XCTestCase objects (or anything that references it)
问题 I am trying to start unit testing on my swift iOS app but have run in to a total road block. I cannot seem to access anything that uses my appDelegate. My appDelegate has a UserController object which stores and manages the logged on user and it's various pieces of data. In order to simplify calling the userController I created a custom subclass of NSObject which all my model classes subclass. In it it has let userController : UserController = (UIApplication.sharedApplication().delegate as!