Untitled

mail@pastecode.io avatar
unknown
swift
21 days ago
231 B
3
Indexable
Never
class Foo {
    var callbacks: [() -> Void] = []

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

    deinit {
        print("foo: deinit")
    }

    func bar() { }
}

if true {
    let foo = Foo()
}
Leave a Comment