Twitter | Search | |
This is the legacy version of twitter.com. We will be shutting it down on 15 December 2020. Please switch to a supported browser or device. You can see a list of supported browsers in our Help Center.
Eneko Alonso Aug 24
Replying to @steipete
I would assume it would only be called if the initializer was successful and an instance was allocated in memory. What did you find?
Reply Retweet Like
Peter Steinberger Aug 24
Replying to @eneko
Yup! RTed the answer
Reply Retweet Like
Javi #BlackLivesMatter Aug 24
Replying to @steipete
I think it can’t, because self isn’t fully initialized so some variables may not be set 😨
Reply Retweet Like
Doug Gregor Aug 24
Replying to @Javi @steipete
That’s correct. If an initializer throws or fails, the initialized stored properties of the partially-constructed self will be torn down but the deinit will not be called (because that would violate memory safety).
Reply Retweet Like
Johannes Weiss Aug 24
Replying to @steipete
Generally speaking no (can't because not fully initialised). However, if all properties are initialised directly in the declaration, then yes :)
Reply Retweet Like
Johannes Weiss Aug 24
Replying to @steipete
Which can be used to create this absolute monster (showing the difference between Optional<Int> and Int? ).
Reply Retweet Like
Dane Aug 24
Replying to @steipete
You’re focused on the deinit? My mind is blown seeing a not equals character in code vs ‘!=‘. How do you type that in?
Reply Retweet Like
Peter Steinberger Aug 24
Replying to @dmiluski
Reply Retweet Like
Jack 🔥🌸 Aug 24
Replying to @steipete
Did you get OSLog store working on iOS 14?
Reply Retweet Like
Peter Steinberger Aug 24
Replying to @JackoPlane
With a back
Reply Retweet Like