ALButton是UIButton的子类,添加了一些功能,减少UIButton自定义外观和行为的行数,并且添加了一些Swfit的优势。
三种初始化方式:
//- 1. Full Initializationlet style = ALButton.ButtonStyle()//-- set stylelet myButton = ALButton(title: "Button Title", style: style, touchUpInsideHandler: { (sender ) in //-- Implement touch up inside event here})//- 2. Simple initialization with style:var style = ALButton.ButtonStyle()//-- set stylelet myButton = ALButton(title: "Button Title", style: style)//- 3. Short initializationlet myButton = ALButton(title: "Button Title")
评论