当我使用Xcode时,如何为视图提供正确的ViewController类?

当我使用Xcode时,如何为视图提供正确的ViewController类?

问题描述:

当我在MainStoryboard中单击不同的ViewController时,我希望在屏幕的其他部分自动生成正确的ViewController自定义类。我怎样才能解决这个问题在Xcode?当我使用Xcode时,如何为视图提供正确的ViewController类?

+0

使用https://*.com/questions/5624972/how-to-display-the-assistant-editor +在编辑器中选择自动? – Larme

当你的助理编辑,确保下已自动选择降:

enter image description here


enter image description here

您应该分配您的自定义类t在Storyboard中创建的帽子。在下面的屏幕截图中显示的字段中选择viewcontroller并键入class。 enter image description here