diff --git a/Sources/Ahoy/Ahoy.swift b/Sources/Ahoy/Ahoy.swift index 9c6dac2..7bd1ed7 100644 --- a/Sources/Ahoy/Ahoy.swift +++ b/Sources/Ahoy/Ahoy.swift @@ -114,9 +114,9 @@ public final class Ahoy { .eraseToAnyPublisher() } - /// A fire-and-forget convenience function for `track(events:)` - public func track(_ events: Event...) { - track(events: events) + /// A fire-and-forget convenience function for tracking a single event + public func track(_ eventName: String, properties: [String: Encodable] = [:]) { + track(events: [.init(name: eventName, properties: properties)]) .retry(3) .sink(receiveCompletion: { _ in }, receiveValue: {}) .store(in: &cancellables) diff --git a/Sources/Ahoy/Event.swift b/Sources/Ahoy/Event.swift index 38d425f..d976fcb 100644 --- a/Sources/Ahoy/Event.swift +++ b/Sources/Ahoy/Event.swift @@ -33,9 +33,3 @@ public struct Event: Encodable { try container.encode(time, forKey: .time) } } - -extension Event: ExpressibleByStringLiteral { - public init(stringLiteral value: String) { - self.init(name: value, properties: [:]) - } -}