Protocol
TriggerProviderProtocol
@objc(PermutiveTriggerProviderProtocol)
public protocol TriggerProviderProtocol
Interface for Trigger Provider instances. Objective C support prevents generics.
Relationships
Types Conforming to TriggerProviderProtocol
TriggerProviderClass which confirms to
TriggerProviderProtocoland creates instances of TriggerActions.
Requirements
action(boolFor:action:)
func action(boolFor queries: Set<Int>, action: @escaping (_ query: Int, _ result: Bool) -> Void) -> TriggerAction?
Creates a TriggerAction for a Bool result and the given segments
Parameters
| Name | Type | Description |
|---|---|---|
| queries | Set<Int> |
The query ids. |
| action | @escaping (_ query: Int, _ result: Bool) -> Void |
An escaping closure to be performed when any of the provided segments change their value. |
| query | The query number which triggered. |
|
| result | The updated value of the segment. |
Returns
An optional TriggerAction instance
action(intFor:action:)
func action(intFor queries: Set<Int>, action: @escaping (_ query: Int, _ result: Int) -> Void) -> TriggerAction?
Creates a TriggerAction for a Int result and the given segments
Parameters
| Name | Type | Description |
|---|---|---|
| queries | Set<Int> |
The query ids. |
| action | @escaping (_ query: Int, _ result: Int) -> Void |
An escaping closure to be performed when any of the provided segments change their value. |
| query | The query number which triggered. |
|
| result | The updated value of the segment. |
Returns
An optional TriggerAction instance
action(int64For:action:)
func action(int64For queries: Set<Int>, action: @escaping (_ query: Int, _ result: Int64) -> Void) -> TriggerAction?
Creates a TriggerAction for a Int64 result and the given segments
Parameters
| Name | Type | Description |
|---|---|---|
| queries | Set<Int> |
The query ids. |
| action | @escaping (_ query: Int, _ result: Int64) -> Void |
An escaping closure to be performed when any of the provided segments change their value. |
| query | The query number which triggered. |
|
| result | The updated value of the segment. |
Returns
An optional TriggerAction instance
action(floatFor:action:)
func action(floatFor queries: Set<Int>, action: @escaping (_ query: Int, _ result: Float) -> Void) -> TriggerAction?
Creates a TriggerAction for a Float result and the given segments
Parameters
| Name | Type | Description |
|---|---|---|
| queries | Set<Int> |
The query ids. |
| action | @escaping (_ query: Int, _ result: Float) -> Void |
An escaping closure to be performed when any of the provided segments change their value. |
| query | The query number which triggered. |
|
| result | The updated value of the segment. |
Returns
An optional TriggerAction instance
action(doubleFor:action:)
func action(doubleFor queries: Set<Int>, action: @escaping (_ query: Int, _ result: Double) -> Void) -> TriggerAction?
Creates a TriggerAction for a Double result and the given segments
Parameters
| Name | Type | Description |
|---|---|---|
| queries | Set<Int> |
The query ids. |
| action | @escaping (_ query: Int, _ result: Double) -> Void |
An escaping closure to be performed when any of the provided segments change their value. |
| query | The query number which triggered. |
|
| result | The updated value of the segment. |
Returns
An optional TriggerAction instance
action(dictionaryFor:action:)
func action(dictionaryFor queries: Set<Int>, action: @escaping (_ query: Int, _ result: [AnyHashable: Any]) -> Void) -> TriggerAction?
Creates a TriggerAction for a Dictionary<AnyHashable: AnyHashable> result and the given segments
Parameters
| Name | Type | Description |
|---|---|---|
| queries | Set<Int> |
The query ids. |
| action | @escaping (_ query: Int, _ result: [AnyHashable: Any]) -> Void |
An escaping closure to be performed when any of the provided segments change their value. |
| query | The query number which triggered. |
|
| result | The updated value of the segment. |
Returns
An optional TriggerAction instance
actionUpdateForUserIdentity(action:)
func actionUpdateForUserIdentity(action: @escaping (String) -> Void) -> TriggerAction?
Creates a TriggerAction for an user identity change
Parameters
| Name | Type | Description |
|---|---|---|
| action | @escaping (String) -> Void |
An escaping closure to be performed when the user identity changed |
Returns
An optional TriggerAction instance