title: How to get a mutable copy of a class in swift?
body: <p>The swift language guide explains how classes in swift are reference types and structs are value i.e. when an instance of a struct is created, it is copied into the new identity instead of a reference to it, whereas, a new instance of a class created from another instance of a class are mere reference to the same class. (<a href="https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/ClassesAndStructures.html#//apple_ref/doc/uid/TP40014097-CH13-ID88" rel="nofollow">https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/ClassesAndStructures.html#//apple_ref/doc/uid/TP40014097-CH13-ID88</a>)</p>
  
  <blockquote>
    <p>Structures and Enumerations Are Value Types</p>
    
    <p>A value type is a type whose value is copied when it is assigned to a
    variable or constant, or when it is passed to a function.</p>
  </blockquote>
  
  <p>...</p>
  
  <blockquote>
    <p>Classes Are Reference Types</p>
    
    <p>Unlike value types, reference types are not copied when they are
    assigned to a variable or constant, or when they are passed to a
    function. Rather than a copy, a reference to the same existing
    instance is used instead.</p>
  </blockquote>
  
  <p>Is there a way to create a mutable copy of a class that can be use independent of the class it inherited from?</p>