Skip to content

Instantly share code, notes, and snippets.

@Arrlindii
Created August 28, 2018 21:24
Show Gist options
  • Select an option

  • Save Arrlindii/5eb828a3a96b07f44eb4e2ff3da3bc2f to your computer and use it in GitHub Desktop.

Select an option

Save Arrlindii/5eb828a3a96b07f44eb4e2ff3da3bc2f to your computer and use it in GitHub Desktop.
enum NotificationName {
case emailChangeNotification
}
protocol StateChangeObserver : class {
func didChange(_ notification: NotificationName, value: String)
}
class LoginData {
weak var observer:StateChangeObserver?
var email: String = "" {
didSet {
observer?.didChange(.emailChangeNotification, value: email)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment