Skip to content

Commit 0c1e330

Browse files
authored
Identify docs fix (#175)
* fix: improve identify documentation * fix: remove extra space Co-authored-by: Alan Charles <[email protected]>
1 parent 939a041 commit 0c1e330

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

Sources/Segment/Events.swift

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@ extension Analytics {
3535

3636
/// Associate a user with their unique ID and record traits about them.
3737
/// - Parameters:
38-
/// - userId: A database ID (or email address) for this user. If you don't have a userId
39-
/// but want to record traits, you should pass nil. For more information on how we
40-
/// generate the UUID and Apple's policies on IDs, see https://segment.io/libraries/ios#ids
41-
/// - traits: A dictionary of traits you know about the user. Things like: email, name, plan, etc.
38+
/// - userId: A database ID for this user. If you don't have a userId
39+
/// but want to record traits, just pass traits into the event and they will be associated
40+
/// with the anonymousId of that user. For more information on how we
41+
/// generate the UUID and Apple's policies on IDs, see
42+
/// https://segment.io/libraries/ios#ids
43+
/// - traits: A dictionary of traits you know about the user. Things like: email, name, plan, etc.
4244
public func identify<T: Codable>(userId: String, traits: T?) {
4345
do {
4446
if let traits = traits {
@@ -72,7 +74,7 @@ extension Analytics {
7274

7375
/// Associate a user with their unique ID and record traits about them.
7476
/// - Parameters:
75-
/// - userId: A database ID (or email address) for this user.
77+
/// - userId: A database ID for this user.
7678
/// For more information on how we generate the UUID and Apple's policies on IDs, see
7779
/// https://segment.io/libraries/ios#ids
7880
/// In the case when user logs out, make sure to call ``reset()`` to clear user's identity info.
@@ -132,9 +134,11 @@ extension Analytics {
132134
extension Analytics {
133135
/// Associate a user with their unique ID and record traits about them.
134136
/// - Parameters:
135-
/// - userId: A database ID (or email address) for this user. If you don't have a userId
136-
/// but want to record traits, you should pass nil. For more information on how we
137-
/// generate the UUID and Apple's policies on IDs, see https://segment.io/libraries/ios#ids
137+
/// - userId: A database ID for this user. If you don't have a userId
138+
/// but want to record traits, just pass traits into the event and they will be associated
139+
/// with the anonymousId of that user. For more information on how we
140+
/// generate the UUID and Apple's policies on IDs, see
141+
/// https://segment.io/libraries/ios#ids
138142
/// - properties: A dictionary of traits you know about the user. Things like: email, name, plan, etc.
139143
public func track(name: String, properties: [String: Any]? = nil) {
140144
var props: JSON? = nil
@@ -151,9 +155,11 @@ extension Analytics {
151155

152156
/// Associate a user with their unique ID and record traits about them.
153157
/// - Parameters:
154-
/// - userId: A database ID (or email address) for this user.
155-
/// For more information on how we generate the UUID and Apple's policies on IDs, see
156-
/// https://segment.io/libraries/ios#ids
158+
/// - userId: A database ID for this user. If you don't have a userId
159+
/// but want to record traits, just pass traits into the event and they will be associated
160+
/// with the anonymousId of that user. For more information on how we
161+
/// generate the UUID and Apple's policies on IDs, see
162+
/// https://segment.io/libraries/ios#ids
157163
/// - traits: A dictionary of traits you know about the user. Things like: email, name, plan, etc.
158164
/// In the case when user logs out, make sure to call ``reset()`` to clear user's identity info.
159165
public func identify(userId: String, traits: [String: Any]? = nil) {

0 commit comments

Comments
 (0)