Untitled

Anonymous
Swift
02/05/2024 11:18 AM
215 B
23
Indexable
Never
class Foo {
    var callbacks: [() -> Void] = []

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

    deinit {
        print("foo: deinit")
    }

    func bar() { }
}

let foo = Foo()
Editor is loading...
Leave a Comment