From 3591b7790fde9b74b97b8e57660dbf78eb6657dd Mon Sep 17 00:00:00 2001 From: Alan Charles Date: Tue, 8 Nov 2022 14:33:26 -0700 Subject: [PATCH 1/2] fix: improve identify documentation --- Sources/Segment/Events.swift | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/Sources/Segment/Events.swift b/Sources/Segment/Events.swift index fd2220e9..da50dc48 100644 --- a/Sources/Segment/Events.swift +++ b/Sources/Segment/Events.swift @@ -35,10 +35,12 @@ extension Analytics { /// Associate a user with their unique ID and record traits about them. /// - Parameters: - /// - userId: A database ID (or email address) for this user. If you don't have a userId - /// but want to record traits, you should pass nil. For more information on how we - /// generate the UUID and Apple's policies on IDs, see https://segment.io/libraries/ios#ids - /// - traits: A dictionary of traits you know about the user. Things like: email, name, plan, etc. + /// - userId: A database ID for this user. If you don't have a userId + /// but want to record traits, just pass traits into the event and they will be associated + /// with the anonymousId of that user. For more information on how we + /// generate the UUID and Apple's policies on IDs, see + /// https://segment.io/libraries/ios#ids + /// - traits: A dictionary of traits you know about the user. Things like: email, name, plan, etc. public func identify(userId: String, traits: T?) { do { if let traits = traits { @@ -72,7 +74,7 @@ extension Analytics { /// Associate a user with their unique ID and record traits about them. /// - Parameters: - /// - userId: A database ID (or email address) for this user. + /// - userId: A database ID for this user. /// For more information on how we generate the UUID and Apple's policies on IDs, see /// https://segment.io/libraries/ios#ids /// In the case when user logs out, make sure to call ``reset()`` to clear user's identity info. @@ -132,9 +134,11 @@ extension Analytics { extension Analytics { /// Associate a user with their unique ID and record traits about them. /// - Parameters: - /// - userId: A database ID (or email address) for this user. If you don't have a userId - /// but want to record traits, you should pass nil. For more information on how we - /// generate the UUID and Apple's policies on IDs, see https://segment.io/libraries/ios#ids + /// - userId: A database ID for this user. If you don't have a userId + /// but want to record traits, just pass traits into the event and they will be associated + /// with the anonymousId of that user. For more information on how we + /// generate the UUID and Apple's policies on IDs, see + /// https://segment.io/libraries/ios#ids /// - properties: A dictionary of traits you know about the user. Things like: email, name, plan, etc. public func track(name: String, properties: [String: Any]? = nil) { var props: JSON? = nil @@ -151,9 +155,11 @@ extension Analytics { /// Associate a user with their unique ID and record traits about them. /// - Parameters: - /// - userId: A database ID (or email address) for this user. - /// For more information on how we generate the UUID and Apple's policies on IDs, see - /// https://segment.io/libraries/ios#ids + /// - userId: A database ID for this user. If you don't have a userId + /// but want to record traits, just pass traits into the event and they will be associated + /// with the anonymousId of that user. For more information on how we + /// generate the UUID and Apple's policies on IDs, see + /// https://segment.io/libraries/ios#ids /// - traits: A dictionary of traits you know about the user. Things like: email, name, plan, etc. /// In the case when user logs out, make sure to call ``reset()`` to clear user's identity info. public func identify(userId: String, traits: [String: Any]? = nil) { From d0b0eac48937536047440f905f24915bc48cb918 Mon Sep 17 00:00:00 2001 From: Alan Charles Date: Tue, 8 Nov 2022 14:34:55 -0700 Subject: [PATCH 2/2] fix: remove extra space --- Sources/Segment/Events.swift | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/Segment/Events.swift b/Sources/Segment/Events.swift index da50dc48..09ddcdaf 100644 --- a/Sources/Segment/Events.swift +++ b/Sources/Segment/Events.swift @@ -35,7 +35,7 @@ extension Analytics { /// Associate a user with their unique ID and record traits about them. /// - Parameters: - /// - userId: A database ID for this user. If you don't have a userId + /// - userId: A database ID for this user. If you don't have a userId /// but want to record traits, just pass traits into the event and they will be associated /// with the anonymousId of that user. For more information on how we /// generate the UUID and Apple's policies on IDs, see @@ -134,7 +134,7 @@ extension Analytics { extension Analytics { /// Associate a user with their unique ID and record traits about them. /// - Parameters: - /// - userId: A database ID for this user. If you don't have a userId + /// - userId: A database ID for this user. If you don't have a userId /// but want to record traits, just pass traits into the event and they will be associated /// with the anonymousId of that user. For more information on how we /// generate the UUID and Apple's policies on IDs, see @@ -155,7 +155,7 @@ extension Analytics { /// Associate a user with their unique ID and record traits about them. /// - Parameters: - /// - userId: A database ID for this user. If you don't have a userId + /// - userId: A database ID for this user. If you don't have a userId /// but want to record traits, just pass traits into the event and they will be associated /// with the anonymousId of that user. For more information on how we /// generate the UUID and Apple's policies on IDs, see