Masu-SwiftiOS 占位符
Masu-Swift 是 iOS 样板的占位符。
用法:
import Masu_Swift // UIView demo let masu = Masu(frame: CGRectMake(0, 300, 220, 100)) masu.backgroundColor = UIColor(red: 0, green: 0.5, blue: 0.5, alpha: 1) masu.text = "View" self.view.addSubview(masu) // UIImage demo let btn = UIButton.buttonWithType(UIButtonType.Custom) as! UIButton btn.frame = CGRectMake(220, 300, 100, 100) btn.setImage(Masu.imageWithSize(btn.frame.size, backgroundColor: UIColor.grayColor(), labelText: "Button"), forState: UIControlState.Normal) self.view.addSubview(btn)
评论