Contents

allServices

A dictionary of all publishable services declared by your app, indexed by service name.

Declaration

static var allServices: [WAPublishableService.ID : WAPublishableService] { get }

Mentioned in

Discussion

The system populates the contents of this property from the values under the Info.plist key “WiFiAwareServices”, with all entries that specify the Publishable configuration included.

You can select a service from this property using the serviceName as the key to pull elements from the dictionary, or by using an extension as follows:

// Index into the dictionary.
let myService = WAPublishableService.allServices["_example-service._tcp"]!

// Give the service a symbol name.
extension WAPublishableService {
	public static var exampleService: WAPublishableService {
		allServices["_example-service._tcp"]!
	}
}
let myService = .exampleService