【发布时间】:2017-12-11 22:06:46
【问题描述】:
我正在努力让 HandyUIKit 字符串扩展与 AppKit 一起使用。
什么是等价物
var font : UIFont
font.withSize(font.pointSize * scriptedTextSizeRatio)
在 Appkit 和 NSFont 中?
var font : NSFont
font.withSize(font.pointSize * scriptedTextSizeRatio)
这是我正在处理的代码部分:
let capturedSubstring = unprocessedString.attributedSubstring(from: match.range(at: 1)).mutableCopy() as! NSMutableAttributedString
let captureFullRange = NSRange(location: 0, length: capturedSubstring.length)
capturedSubstring.addAttribute(.font, value: font.withSize(font.pointSize * scriptedTextSizeRatio), range: captureFullRange)
【问题讨论】:
-
可可中的 AppKit?怎么样?