title: iOS Swift Add SVG Image to button like Android
body: <p>In Android, we can import SVG as Vector XML,
  Use this as Drawable,
  Change colors of SVG Icons and add to button</p>
  
  <pre><code>void setSvgIcnForBtnFnc(Button setBtnVar, int setSvgVar, int setClrVar, String PosVar)
  {
      Drawable DevDmjVar = getDrawable(setSvgVar);
      DevDmjVar.setBounds(0,0,Dpx24,Dpx24);
      DevDmjVar.setColorFilter(new PorterDuffColorFilter(setClrVar, PorterDuff.Mode.SRC_IN));
      switch (PosVar)
      {
          case "Tit" : setBtnVar.setCompoundDrawables(null, DevDmjVar, null, null); break;
          case "Rit" : setBtnVar.setCompoundDrawables(null, null, DevDmjVar, null); break;
          case "Pit" : setBtnVar.setCompoundDrawables(null, null, null, DevDmjVar); break;
          default: setBtnVar.setCompoundDrawables(DevDmjVar, null, null, null); break;
      }
  }
  </code></pre>
  
  <p>How do I do this in swift for iphones ?</p>
  
  <pre><code>setBtnVar.setImage(&lt;image: UIImage?&gt;, forState: &lt;UIControlState&gt;)
  </code></pre>