label字符加删除线
let label = UILabel(frame: CGRectMake(100, 100, 0, 0))let attr = NSMutableAttributedString(string: "123") attr.addAttribute(NSStrikethroughStyleAttributeName, value: NSNumber(integer: 1), range: NSMakeRange(0, 3)) label.attributedText = attr label.sizeToFit() self.view.addSubview(label)
时间处理:
var date = NSDate()var timeFormatter = NSDateFormatter()timeFormatter.dateFormat = "yyy-MM-dd 'at' HH:mm:ss.SSS" (格式可俺按自己需求修整)var strNowTime = timeFormatter.stringFromDate(date) as String