如何使用 Storyboard UI in "XCODE" 对标题文本设置约束,使其大小相对于超级视图的大小?

How can one set constraints to the title text such that it's size is relative to that of the superview using the Storyboard UI in "XCODE"?

我需要对我的应用程序的标题文本设置约束,使文本的字体大小与超级视图的字体大小相关。这将有助于文本随屏幕大小而变化。

找到了如何操作。

所以我所做的是:

  1. 我通过以下方式链接并为我的标题文本创建了一个变量:
@IBOutlet weak var iXyloTitle: UILabel!
  1. 然后我所做的是,设置标题文本相对于超级视图的大小,即:0.031 到超级视图的大小:
iXyloTitle.font = iXyloTitle.font.withSize(self.view.frame.height * 0.031)