Skip to content

Instantly share code, notes, and snippets.

@basilche
Created July 9, 2019 04:51
Show Gist options
  • Save basilche/9443ef72995f2cee9377c087e87096f7 to your computer and use it in GitHub Desktop.
Save basilche/9443ef72995f2cee9377c087e87096f7 to your computer and use it in GitHub Desktop.
@Published var title: String = ""
//And then you can change the variable itself:
title = "Bob"
//And also to track its changes:
let titleSubscription = $title.sink {
print("new title is '\($0)'")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment