---
metadata:
  - name: generator
    content: Diplodoc Platform v5.63.4
alternate:
  - https://appmetrica.yandex.com/docs/en/sdk/ios/analytics/swift/CustomStringAttribute.md
  - https://appmetrica.yandex.com/docs/ru/sdk/ios/analytics/swift/CustomStringAttribute.md
  - https://appmetrica.yandex.com/docs/zh/sdk/ios/analytics/swift/CustomStringAttribute.md
  - href: https://appmetrica.yandex.com/docs/zh/sdk/ios/analytics/swift/CustomStringAttribute.md
    type: text/markdown
    title: Markdown version
  - href: https://appmetrica.yandex.com/docs/zh/llms.txt?revision=r21698989
    rel: describedby
---
> **Documentation Index:** Fetch the complete configuration index at https://appmetrica.yandex.com/docs/zh/llms.txt?revision=r21698989

# CustomStringAttribute 协议

该协议定义了更新字符串属性值的方法。

## Instance methods {#instance_summary}

#|
|| [withValue(_:)](#method_withValue) | 更新属性值。 ||
|| [withValueIfUndefined(_:)](#method_withValueIfUndefined) | 如果属性值之前未设置，则更新属性值。 ||
|| [withValueReset()](#method_withValueReset) | 重置属性值。 ||
|#

## Method descriptions {#method_detail}

### withValue(_:) {#method_withValue}

```swift translate=no
func withValue(_ value: String?) -> UserProfileUpdate
```

更新属性值。

**参数：**

#|
|| `value` | 属性值为字符串。 最大值长度为200个字符。 ||
|#

**返回：**

The `用户配置更新` 类实例。

### withValueIfUndefined(_:) {#method_withValueIfUndefined}

```swift translate=no
func withValueIfUndefined(_ value: String?) -> UserProfileUpdate
```

如果属性值之前未设置，则更新属性值。

**参数：**

#|
|| `value` | 属性值为字符串。 最大值长度为200个字符。 ||
|#

**返回：**

The `用户配置更新` 类实例。

### withValueReset() {#method_withValueReset}

```swift translate=no
func withValueReset() -> UserProfileUpdate
```

重置属性值。

**返回：**

The `用户配置更新` 类实例。
