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

# UserProfile 类

不可变类，用于存储用户资料。

使用 [MutableUserProfile](https://appmetrica.yandex.by/docs/zh/sdk/ios/analytics/swift/MutableUserProfile.md) 类来修改用户资料。

用户资料档案是一组用户属性。 用户个人资料显示在AppMetrica的用户个人资料报告中。

应将 `UserProfile` 类的实例传递到 AppMetrica服务器，使用 [reportUserProfile](https://appmetrica.yandex.by/docs/zh/sdk/ios/analytics/swift/AppMetrica.md#reportuserprofile_onfailure-method_reportuserprofile) 方法（[AppMetrica](https://appmetrica.yandex.by/docs/zh/sdk/ios/analytics/swift/AppMetrica.md) 类）。 使用 [ProfileAttribute](https://appmetrica.yandex.by/docs/zh/sdk/ios/analytics/swift/ProfileAttribute.md) 类的方法来创建用户属性。

## Instance methods {#instance_summary}

#|
|| [init(updates:)](#method_initWithUpdates) | 用指定的更新集初始化用户资料。 ||
|#

## Properties {#property_summary}

#|
|| [更新](#property_updates) | 包含属性更新的数组。 ||
|#

## Method descriptions {#method_detail}

### init(updates:) {#method_initWithUpdates}

```swift translate=no
init(updates: [UserProfileUpdate])
```

用指定的更新集初始化用户资料。

**参数：**

#|
|| `更新` | 包含属性更新的数组。 ||
|#

**返回：**

The `用户配置文件` 类实例。

## Property descriptions {#property_detail}

### updates {#property_updates}

`var updates: [UserProfileUpdate] { get }`

包含属性更新的数组。
