Home > AI > IOS > Combine >

append(_:)

Example 1

let numbers = (0...10)
let otherNumbers = (25...35)
let cancellable = numbers.publisher
    .append(otherNumbers.publisher)
    .sink { print("\($0)", terminator: " ") }

Example 2:


let prefixValues = [0, 1, 255]
let dataElements = (0...10)
let cancellable = dataElements.publisher
    .prepend(prefixValues)
    .sink { print("\($0)", terminator: " ") }

Leave a Reply