I have timer method where it get called whenever new instance is created. I want every ticker should be stored in dictionary with respect to each instance like [test1: 1, test2: 1] , [test1: 2, test2: 2] ......So on
var subscriptions = Set()
var dict = NSMutableDictionary()
func multiplecall(name: String) {
Timer.publish(every: 1, on: .main, in: .common)
.autoconnect()
.scan(1) { value, _ in value + 1 }
.sink(receiveValue: fetchValues)
.store(in: &subscriptions)
}
func fetchValues(ticker: Int){
print(ticker)
}
/*** Expecting something like this**
func fetchValues(testName: String, ticker: Int){
dict[testName] = ticker
}
multiplecall(name: "test1")
multiplecall(name: "test2")