Untitled

mail@pastecode.io avatar
unknown
swift
10 months ago
215 B
2
Indexable
class Foo {
    var callbacks: [() -> Void] = []

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

    deinit {
        print("foo: deinit")
    }

    func bar() { }
}

let foo = Foo()
Leave a Comment