简体   繁体   中英

UIViewController in storyboard reference class from other target

I have project with 2 targets: CoreD and MultiT.
Each target contains: Main.storyboard and ViewController.swift
Each of these files has target membership only in its own target.

在此处输入图片说明

When i open Main storyboard in CoreD target, to create outlets and actions, ViewController class in identity inspector is class from other target(MultiT), not from target to which storyboard belongs.

在此处输入图片说明

My XCode version is 9.4.1

Is there way to fix this, other than changing names of view controllers?

Select the vc from

Manual ->TargetName->ViewController.swift

Then hook the outlets & actions , you'll be able to connect them if the vc is inside the target of the storyboard and assigned correctly as the class name despite it's not showing as automatic as xcode sometimes glitches in it

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM