setConfiguration(_:for:)
setConfiguration(_:for:)
setConfiguration(_:for:) Instance Method of AEAssessmentConfiguration Adds an app to the list of apps available during an assessment.
func setConfiguration(_ configuration: AEAssessmentParticipantConfiguration, for application: AEAssessmentApplication)Parameters
configuration
The configuration of the secondary app.
application
The app that you want to configure.
Discussion
Use this method to make an app besides your own available during an assessment. Create a representation of the app that you want to allow as an AEAssessmentApplication instance, and the configuration for that app using an AEAssessmentParticipantConfiguration instance:
let calculator = AEAssessmentApplication(bundleIdentifier: "com.apple.calculator")
let calculatorConfig = AEAssessmentParticipantConfiguration()
calculatorConfig.allowsNetworkAccess = false // Calculator doesn't need the network.Use the app and its configuration to create an assessment configuration, and either create an assessment session with that, or update an existing session as shown below:
let configuration = AEAssessmentConfiguration()
configuration.setConfiguration(calculatorConfig, for: calculator)
session.update(to: configuration)You can get a list of the currently allowed apps by accessing the configurationsByApplication property. You can disallow a previously allowed app by using the remove(:)) method.