Skip to content

Commit c9d0c71

Browse files
authored
correct identify doc (#114)
* fix identify doc issue * add codecov to gha workflow * add badges * enable test coverage * revert changes on codecov
1 parent 1e6dfd7 commit c9d0c71

File tree

3 files changed

+18
-12
lines changed

3 files changed

+18
-12
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# Analytics-Swift
2+
![](https://github.com/segmentio/analytics-swift/actions/workflows/swift.yml/badge.svg)
3+
![](https://img.shields.io/github/license/segmentio/analytics-swift)
24

35
NOTE: This project is currently in the Beta phase and is covered by Segment's [First Access & Beta Preview Terms](https://segment.com/legal/first-access-beta-preview/). We encourage you
46
to try out this new library. Please provide feedback via Github issues/PRs, and feel free to submit pull requests.

Sources/Segment/Events.swift

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,10 @@ extension Analytics {
7373

7474
/// Associate a user with their unique ID and record traits about them.
7575
/// - Parameters:
76-
/// - userId: A database ID (or email address) for this user. If you don't have a userId
77-
/// but want to record traits, you should pass nil. For more information on how we
78-
/// generate the UUID and Apple's policies on IDs, see https://segment.io/libraries/ios#ids
76+
/// - userId: A database ID (or email address) for this user.
77+
/// For more information on how we generate the UUID and Apple's policies on IDs, see
78+
/// https://segment.io/libraries/ios#ids
79+
/// In the case when user logs out, make sure to call ``reset()`` to clear user's identity info.
7980
public func identify(userId: String) {
8081
let event = IdentifyEvent(userId: userId, traits: nil)
8182
store.dispatch(action: UserInfo.SetUserIdAction(userId: userId))
@@ -151,10 +152,11 @@ extension Analytics {
151152

152153
/// Associate a user with their unique ID and record traits about them.
153154
/// - Parameters:
154-
/// - userId: A database ID (or email address) for this user. If you don't have a userId
155-
/// but want to record traits, you should pass nil. For more information on how we
156-
/// generate the UUID and Apple's policies on IDs, see https://segment.io/libraries/ios#ids
155+
/// - userId: A database ID (or email address) for this user.
156+
/// For more information on how we generate the UUID and Apple's policies on IDs, see
157+
/// https://segment.io/libraries/ios#ids
157158
/// - traits: A dictionary of traits you know about the user. Things like: email, name, plan, etc.
159+
/// In the case when user logs out, make sure to call ``reset()`` to clear user's identity info.
158160
public func identify(userId: String, traits: [String: Any]? = nil) {
159161
do {
160162
if let traits = traits {

Sources/Segment/ObjC/ObjCAnalytics.swift

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,22 @@ extension ObjCAnalytics {
3838

3939
/// Associate a user with their unique ID and record traits about them.
4040
/// - Parameters:
41-
/// - userId: A database ID (or email address) for this user. If you don't have a userId
42-
/// but want to record traits, you should pass nil. For more information on how we
43-
/// generate the UUID and Apple's policies on IDs, see https://segment.io/libraries/ios#ids
41+
/// - userId: A database ID (or email address) for this user.
42+
/// For more information on how we generate the UUID and Apple's policies on IDs, see
43+
/// https://segment.io/libraries/ios#ids
44+
/// In the case when user logs out, make sure to call ``reset()`` to clear user's identity info.
4445
@objc(identify:)
4546
public func identify(userId: String) {
4647
identify(userId: userId, traits: nil)
4748
}
4849

4950
/// Associate a user with their unique ID and record traits about them.
5051
/// - Parameters:
51-
/// - userId: A database ID (or email address) for this user. If you don't have a userId
52-
/// but want to record traits, you should pass nil. For more information on how we
53-
/// generate the UUID and Apple's policies on IDs, see https://segment.io/libraries/ios#ids
52+
/// - userId: A database ID (or email address) for this user.
53+
/// For more information on how we generate the UUID and Apple's policies on IDs, see
54+
/// https://segment.io/libraries/ios#ids
5455
/// - traits: A dictionary of traits you know about the user. Things like: email, name, plan, etc.
56+
/// In the case when user logs out, make sure to call ``reset()`` to clear user's identity info.
5557
@objc(identify:traits:)
5658
public func identify(userId: String, traits: [String: Any]?) {
5759
analytics.identify(userId: userId, traits: traits)

0 commit comments

Comments
 (0)