Can't link to outlet collection in XCode9

守給你的承諾、 提交于 2019-12-23 12:17:21

问题


I have some constraints that a shuffle around during an animation. After upgrading to XCode9 I tried to make some tweaks, and the editor seems to no longer allow me to add constraints to an constraint collection IBOutlet. I even created a new project and tried to make a simple outlet collection and ran into the same issue. Here's a short video of what I'm talking about:

I've tried the usual things of deleting derived data, restarting xcode, creating new xibs, praying to the xcode gods...etc. As you can see in the gif, it even happens to me in a brand new project. Anybody else seeing this? Any work-around I'm missing?

I think this is a legit bug, I submitted it to apple.

I'm surprised I don't see anybody else running into this.


回答1:


I had the same issue. This is the only workaround I could find to get it working is to create the Outlet Collection in code (or create the first one by dragging from the storyboard as you're doing). Then drag from the 'add' icon in the ViewController's line margin back to the objects on the storyboard rather than the usual way around.

This also seems to be an alternative way: https://stackoverflow.com/a/45597939/1320134

In summary, you need create the first outlet collection as you are currently doing, then drag from the newly created 'referencing outlet collection' in the Connections Inspector to the other objects you want to add to the collection in the storyboard.




回答2:


I tried the same and got the following result. I guess it's working the other way. Check this link out.

Steps:

  1. Drag the required outlet to the view controller file.
  2. Select the outlet collection, name it and add it to view controller class file.
  3. Select the outlet collection created in view controller file from the circle button showing the connection.
  4. Drag from outlet connection to your desired outlet of the same type and it will be automatically added to the same outlet collection.
  5. Or you can do it by going to connection inspector on the utility box on the right-hand side.
  6. Find the desired outlet.
  7. Click on connection circle and drag to the outlet you want to connect and it will be added directly to the outlet collection.

Hope this helps you. Thanks!



来源:https://stackoverflow.com/questions/46384857/cant-link-to-outlet-collection-in-xcode9

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!