Home > AI > IOS > Combine >

sink(receiveCompletion:receiveValue:)

API

Example:

class UserSettings {
 
    init() {
        let a = (1...3)
        a.publisher
            .sink {
                print("\($0)")
            }
    }
}

let user = UserSettings()

Run swift UserSettings.swift on terminal

Leave a Reply