Instance Method
setAttribute(_:forKey:) setAttribute:forKey: setAttribute_forKey_
Sets or removes an attribute.
Declaration
func setAttribute(_ value: Any?, forKey key: GSShapeKey)Declaration
- (void) setAttribute:(id) value forKey:(GSShapeKey) key;Declaration
setAttribute_forKey_(value: object, key: GSShapeKey)Parameters
valueA value that supports property-list encoding, or
nilto remove the attribute.
Discussion
Setting an attribute registers undo and notifies the path. Passing nil as the value removes the attribute.
See Also
Attributes
Additional values associated with the node.
The number of attributes.
The value for an attribute key, or
nilif no value is set.Replaces all attributes using values encoded for a file format version.
Replaces all attributes without registering undo or notifying the path.
Removes an attribute.