Instance Method

associate(to:password:)

Associates to a given network using the given network passphrase.

Declaration

func associate(to network: CWNetwork, password: String?) throws

Parameters

network

The network to which the interface will associate.

password

The network passphrase or key. Required for association to WEP, WPA Personal, and WPA2 Personal networks.

error

An NSError object passed by reference, which will be populated with the error code and the error description if an error occurs during the execution of this method. This parameter is optional and can be passed as nil.

Return Value

A Boolean value which will indicate whether or not a failure occurred during execution. YES indicates no error occurred.

Discussion

This method will block for the duration of the association. This operation may require an administrator password.

See Also