我不明白为什么不显示文字
导入 UIKit 导入 AsyncDisplayKit
类视图控制器:ASViewController {
init() {
super.init(node: ASDisplayNode())
let text = ASTextNode()
let attrs = [NSAttributedStringKey.font: UIFont(name: "HelveticaNeue", size: 12.0)!]
let string = NSAttributedString(string: "Hello World!", attributes: attrs)
text.attributedText = string
self.node.addSubnode(text)
}
required init?(coder aDecoder: NSCoder) {
super.init(node: ASDisplayNode.init())
}
}
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
let window = UIWindow(frame: UIScreen.main.bounds)
window.backgroundColor = UIColor.cyan
window.rootViewController = ViewController()
window.makeKeyAndVisible()
self.window = window
return true
}