Overview

If an NSPrincipalClass key is declared in the test bundle's Info.plist file, XCTest automatically creates a single instance of that class when the test bundle is loaded. You can use this instance as a place to register observers or do other pretesting global setup before testing for that bundle begins.

Important

Observers must be registered manually. The NSPrincipalClass instance is not automatically registered as an observer even if the class conforms to XCTestObservation.