title: How to create a custom UIButton in code and use it in a xib?
body: <p>I have a class <code>MyButton : UIButton</code> which inherits from UIButton. I do a bunch of things in the initWithFrame (the only constructor)of MyButton say like setting the backgroundcolor. </p>
  
  <p>Now I want to use this MyButton in my xib. so that I dont keep setting these properties again and again for all my buttons. I have also set the Custom Class to MyButton in the Identity Inspector for the button in the xib. </p>
  
  <p>Nothing still reflects the properties I set in the xib. This could have been easily done if it was in the code. </p>
  
  <p>My question is, 
  1) What gets called when you create button thru a xib (like you call initWithFrame when you programmatically create a button) ?</p>
  
  <p>2) How do I get it to see the properties I set in the MyButton ? Is moving out of xib and doing it programatically the only way ? </p>
  
  <p>thanks in advance !</p>