Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ircular Reference async
let person1 = Person(name: "🐱")
let person2 = Person(name: "🦁")
let person3 = Person(name: "🐷")
let person4 = Person(name: "🐼")
let person5 = Person(name: "🐻")
person1.normalHello()
person2.strongHello()
person3.weakHello()
person4.noescapeHello()
person5.noescapeAndWeakHello()
// 結果
--- init 🐱 ---
--- init 🦁 ---
--- init 🐷 ---
--- init 🐼 ---
--- init 🐻 ---
Hello, I am 🐱!
Hello, I am 🦁!
Hello, I am 🐷!
Hello, I am 🐼!
Hello, I am 🐻!
--- deinit 🐻 ---
--- deinit 🐷 ---
--- deinit 🐱 ---
....🦁 [strong]
....nil [weak]
....🐼 [noescape]
--- deinit 🐼 ---
....nil [noescape and weak]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.