Xcode 14 How can I insert IbCollections in swift file?

I updated the Xcode to 14 today and i find that i can not drag ibOutlet collections to swift file.

When i drag the ibOutlet to swift file, it seems can't find the correct position code to match.

Any Suggestions?Thanks

Replies

Hope I understand correctly.

Imagine you want to create an IBOutlet collection of labels.

  • Create the labels in storyboard
  • control drag from first label to the code.
  • select Collection in the pop up:

  • You see now in code:
    @IBOutlet var test: [UILabel]!
  • control drag from the other labels to the IBOutlet in code.

Note: take care of the order to make sure you later reference the right label in code.

  • Thanks.Yeah i got your means.I know the create process but the xcode seems something went wrong.

    After i created an outlet collection to swift file,it works normal,but when i tried to add a new ibOutlet to this existed outlet collection it can't work.I can only create new outlet and new collection.It's weird seems xcode bug.

    I don't know how to fix this issue,i would try reinstall xcode and have another try

Add a Comment