Untitled

Anonymous
swift
02/05/2024 11:19 AM
308 B
25
Indexable
class Foo {
    var callbacks: [() -> Void] = []

    init() {
        callbacks.append(bar)
        print("foo: inited")
    }

    deinit {
        print("foo: deinit")
    }

    func bar() { }
}

if true {
    let foo = Foo()
}
Editor is loading...
Leave a Comment