---
metadata:
  - name: generator
    content: Diplodoc Platform v5.63.4
alternate:
  - https://appmetrica.yandex.com/docs/en/sdk/ios/analytics/swift/CustomNumberAttribute.md
  - https://appmetrica.yandex.com/docs/ru/sdk/ios/analytics/swift/CustomNumberAttribute.md
  - https://appmetrica.yandex.com/docs/zh/sdk/ios/analytics/swift/CustomNumberAttribute.md
  - href: https://appmetrica.yandex.com/docs/zh/sdk/ios/analytics/swift/CustomNumberAttribute.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

# CustomNumberAttribute 协议

该协议定义了更新数值属性值的方法。

## 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: Double) -> UserProfileUpdate
```

更新属性值。

**参数：**

#|
|| `value` | 数值属性的值。 数据类型是`double`。 ||
|#

**返回：**

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

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

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

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

**参数：**

#|
|| `value` | 数值属性的值。 数据类型是`double`. ||
|#

**返回：**

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

### withValueReset() {#method_withValueReset}

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

重置属性值。

**返回：**

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