I came across a function called deinit() while reading The Swift Programming Language guide, but I\'m still wondering why and when we need to implement it since
If your class manages a file handle or a different resource you can close that handle in deinit to ensure that it doesn't live on after the object has been freed.