Commit 6d18a7d7 authored by Alex朱枝文's avatar Alex朱枝文

我的-关于我们-服务年份逻辑更改

parent e4a6133e
......@@ -68,7 +68,9 @@ class YHAboutGalaxyViewController: YHBaseViewController {
label.lineBreakMode = .byTruncatingTail
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.lineSpacing = 5.0 // 设置行间距
let attributedString = NSMutableAttributedString(string: "专注海外服务17年,总部设立在深圳,现已分别在北京、上海、广州等地建立分公司,立足于香港身份规划服务,业务逐步多元化发展。".local)
let currentYear = Calendar.current.component(.year, from: Date())
let yearsOfService = currentYear - 2007
let attributedString = NSMutableAttributedString(string: "专注海外服务\(yearsOfService)年,总部设立在深圳,现已分别在北京、上海、广州等地建立分公司,立足于香港身份规划服务,业务逐步多元化发展。".local)
attributedString.addAttribute(.paragraphStyle, value: paragraphStyle, range: NSRange(location: 0, length: attributedString.length))
label.attributedText = attributedString
return label
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment