addInputPort(withType:forKey:withAttributes:)
Adds an input port of the specified type and associates a key and attributes with the port.
Declaration
func addInputPort(withType type: String!, forKey key: String!, withAttributes attributes: [AnyHashable : Any]! = [:])Parameters
- type:
The port type. See Port Input And Output Types.
- key:
The key to associate with the port.
- attributes:
A dictionary of attributes for the port. See Input And Output Port Attributes. Although the dictionary is optional, it’s recommended that provide attributes to enhance the experience of those who use your custom patch. The attributes appear in a help tag when the user hovers a pointer over the property port on your custom patch. (See Attributesforpropertyport(withkey:).) Pass
nilif you do not want to provide attributes.
Discussion
This method throws an exception if called from within the execute(_:atTime:withArguments:) method or if there’s already an input or output port with that key.