title: Abstraction in swift / iOS
body: <p>I know there isn't a direct way for implementing abstraction iOS, below is how I am doing it.</p>
  <pre><code>protocol ParentClass: class {
    func doSomething()
    func doSomething1()
  }
  
  class ChildClassA: ParentClass {
    func doSomething() -&gt; Bool {
  
    }
  
    func doSomething1() -&gt; Bool {
  
    }
  }
  
  class ChildClassB: ParentClass {
    func doSomething() -&gt; Bool {
  
    }
  
    func doSomething1() -&gt; Bool {
  
    }
  }
  </code></pre>
  <p>How do I declare initializer in ParentClass? I want to add an initializer which will create object for ChildClassA or ChildClassB. What I basically want is: if a Flag is set, execute doSomething() from ChildClassA or execute doSomething() from ChildClassB.</p>