08 Oct 2020
I was never a fan of failable initializers in Swift. I do not think this is the correct place to fail and return
nil most of the time. Of course, there are exceptions where a failable initializer is appropriate. But there is another behavior of which to be aware. When constructing a class via a failable initializer,
init?() — or a throwing initializer,
init() throws — the deinitializer,
deinit, is not called if initialization fails or throws, respectively.