Contents

allServices

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

Declaration

static var allServices: [WASubscribableService.ID : WASubscribableService] { 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 Subscribable 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 = WASubscribableService.allServices["_example-service._tcp"]!

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