CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.

AJ_UIKit 0.1.0

AJ_UIKit 0.1.0

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Apr 2016
SPMSupports SPM

Maintained by AbooJan.



AJ_UIKit 0.1.0

  • By
  • AbooJan

一些常用的UI控件封装, 支持Storyboard和纯代码

圆角按钮 CommonButton

  let testBtn = CommonButton(type: .Custom);
  testBtn.frame = CGRectMake(20.0, 90.0, 100.0, 40.0);
  testBtn.backgroundColor = UIColor.orangeColor();
  testBtn.setTitleColor(UIColor.whiteColor(), forState: .Normal);
  testBtn.setTitle("测试", forState: .Normal);
  testBtn.addTarget(self, action: #selector(ViewController.testBtnClick(_:)), forControlEvents: .TouchUpInside);

  self.view.addSubview(testBtn);

单选项 Checkbox

  self.checkboxBtn.checkboxImageAlignment = .Right;
  self.checkboxBtn.checkedImage = UIImage(named: "ic_check_1");
  self.checkboxBtn.uncheckedImage = UIImage(named: "ic_check_0");
  self.checkboxBtn.isCheck = true;
  self.checkboxBtn.canCheck = false;
  self.checkboxBtn.title = "checkbox标题";
  self.checkboxBtn.titleFont = UIFont.systemFontOfSize(15.0);
  self.checkboxBtn.privateDelegate = self;

可上下对齐的Label AJLabel

 let testLabel = AJLabel(frame: CGRectMake(20.0, 200.0, 100.0, 40.0));
 testLabel.backgroundColor = UIColor.lightGrayColor();
 testLabel.verticalTextAlignment = .Top; // 垂直方向对齐方式
 testLabel.textEdgeInsets = UIEdgeInsetsMake(0.0, 8.0, 0.0, 0.0); // 边间距
 testLabel.text = "测试Label";
 self.view.addSubview(testLabel);

类似TextField 的TextView AJTextView

 testTV.maxLetterCount = 20;
 testTV.isShowLetterCount = true;
// testTV.limitContentLength = true;
 testTV.placeholder = "请输入内容";
 print("是否超出字数:\(testTV.isOverMaxLength)");