I'm implementing Segment.com's iOS library with Swift and all is working great, just stuck on the code conversion below of the identify
method:
ref: https://segment.com/docs/libraries/ios/#identify
[[SEGAnalytics sharedAnalytics] identify:@"userId"
traits:@{ @"email": @"em@il.com" }];
where traits
is an NSDictionary *, optional
Xcode tells me (typeahead hints) that in Swift it translates to:
SEGAnalytics.sharedAnalytics().identify(userId: String!, traits: [NSObject : AnyObject]!)
As a new Swift developer I'm struggling to get the syntax right to send an object into traits. How can I send in my set of predefined dictionary of optionals into the traits section? Something like: {email : email!, name : fullName!}
Please try to use like this