File tree Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ public extension RuntimeProviderType {
35
35
}
36
36
}
37
37
38
- func log( _ eventName: String , parameters: [ String : Any ] ? ) {
38
+ func log( _ eventName: String , parameters: [ String : PrimitiveType ] ? ) {
39
39
guard self . responds else { return }
40
40
if let instance = self . instance {
41
41
_ = instance. perform ( self . selector, with: eventName, with: parameters)
Original file line number Diff line number Diff line change @@ -5,12 +5,12 @@ public protocol AnalyticsType {
5
5
}
6
6
7
7
public protocol ProviderType {
8
- func log( _ eventName: String , parameters: [ String : Any ] ? )
8
+ func log( _ eventName: String , parameters: [ String : PrimitiveType ] ? )
9
9
}
10
10
11
11
public protocol EventType {
12
12
func name( for provider: ProviderType ) -> String ?
13
- func parameters( for provider: ProviderType ) -> [ String : Any ] ?
13
+ func parameters( for provider: ProviderType ) -> [ String : PrimitiveType ] ?
14
14
}
15
15
16
16
open class Analytics < Event: EventType > : AnalyticsType {
Original file line number Diff line number Diff line change 1
1
import Umbrella
2
+ import Foundation
2
3
3
4
enum TestEvent : EventType {
4
5
case login( username: String )
@@ -24,7 +25,7 @@ enum TestEvent: EventType {
24
25
}
25
26
}
26
27
27
- func parameters( for provider: ProviderType ) -> [ String : Any ] ? {
28
+ func parameters( for provider: ProviderType ) -> [ String : PrimitiveType ] ? {
28
29
switch self {
29
30
case let . login( username) :
30
31
switch provider {
@@ -46,9 +47,9 @@ enum TestEvent: EventType {
46
47
}
47
48
48
49
class MockProvider : ProviderType {
49
- var events : [ ( name: String , parameters: [ String : Any ] ? ) ] = [ ]
50
+ var events : [ ( name: String , parameters: [ String : PrimitiveType ] ? ) ] = [ ]
50
51
51
- func log( _ eventName: String , parameters: [ String : Any ] ? ) {
52
+ func log( _ eventName: String , parameters: [ String : PrimitiveType ] ? ) {
52
53
self . events. append ( ( name: eventName, parameters: parameters) )
53
54
}
54
55
}
You can’t perform that action at this time.
0 commit comments