Last active
February 4, 2022 14:06
-
-
Save SebastianBoldt/e46b7a64afea98f4193e45124a5a6894 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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