0

I wonder how allocation and initialization works (On The Hood) in swift.

Being a beginner of swift language concepts, I wonder how the object creation works.

Does the 2 stage object creation (As in Objective C) is given a bye bye or it is hidden inside.

Stefan Arentz
  • 34,311
  • 8
  • 67
  • 88
riyaz
  • 1,093
  • 1
  • 8
  • 21
  • Why do you care? In Obj-C you always (!) used `[[Class alloc] init]`. Why shedding tears on this concept? – qwerty_so Feb 28 '15 at 12:06
  • just curious @thomas. :/ – riyaz Feb 28 '15 at 12:07
  • 1
    This doesn't answer your question directly, but it's a little bit tangential, if you are interested in the details of memory layouts of Swift classes and structs I recommend awesome posts by Mike Ash, for example [Exploring Swift Memory Layout, Part I](https://www.mikeash.com/pyblog/friday-qa-2014-07-18-exploring-swift-memory-layout.html) and [Part II](https://www.mikeash.com/pyblog/friday-qa-2014-08-01-exploring-swift-memory-layout-part-ii.html) – Teemu Kurppa Feb 28 '15 at 15:24

0 Answers0