let event = pinpointAnalyticsClient.createEvent(withEventType: "SearchButtonClick") event.addAttribute(" ", forKey: "Keyword") // event.addMetric(NSNumber(value: 123, forKey: "SomeMetric") pinpointAnalyticsClient.record(event) pinpointAnalyticsClient.submitEvents() )( let pinpointTargetingClient = pinpointClient.targetingClient pinpointTargetingClient.addAttribute(["Pinpoint"], forKey: "FavoriteServices") pinpointTargetingClient.updateEndpointProfile()