Skip to content

Instantly share code, notes, and snippets.

@SebastianBoldt
Last active February 4, 2022 14:06
Show Gist options
  • Save SebastianBoldt/e46b7a64afea98f4193e45124a5a6894 to your computer and use it in GitHub Desktop.
Save SebastianBoldt/e46b7a64afea98f4193e45124a5a6894 to your computer and use it in GitHub Desktop.
actor BankAccount {
private let accountHolder: String?
// .....
nonisolated func logAccountHolder() {
print(accountHolder ?? "No account holder")
}
}
Task {
let bankAccount = BankAccount(accountHolder: "Sebastian Boldt")
bankAccount.logAccountHolder() // Can be used without using await
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment