---
title: "setProperty(_:)"
framework: modelio
role: symbol
role_heading: Instance Method
path: "modelio/mdlmaterial/setproperty(_:)"
---

# setProperty(_:)

Adds a new material property to or replaces an existing material property in the material.

## Declaration

```swift
func setProperty(_ property: MDLMaterialProperty)
```

## Parameters

- `property`: The material property object to add to the material.

## Discussion

Discussion If the material already contains a material property with the same name or semantic, this method replaces that material property. Otherwise, this method adds the specified material property to the material.

## See Also

### Working with individual material properties

- [propertyNamed(_:)](modelio/mdlmaterial/propertynamed(_:).md)
- [property(with:)](modelio/mdlmaterial/property(with:).md)
- [properties(with:)](modelio/mdlmaterial/properties(with:).md)
- [remove(_:)](modelio/mdlmaterial/remove(_:).md)
- [removeAllProperties()](modelio/mdlmaterial/removeallproperties().md)
