Home > AI > Uncategorized

CombineLast

let selectedFilter = PassthroughSubject<String, Never>()
let searchText = PassthroughSubject<String, Never>()

let publisher = Publishers.CombineLatest(selectedFilter,searchText, transform: { selectedFilter, searchText in
    "\(selectedFilter) \(searchText)"
})

_ = publisher.sink { value in
    print(value)
}

What will this code print?

Related posts:

Leave a Reply