IBOutletCollection set ordering in Interface Builder

前端 未结 10 1076
我寻月下人不归
我寻月下人不归 2020-11-30 22:20

I am using IBOutletCollections to group several Instances of similar UI Elements. In particular I group a number of UIButtons (which are similar to buzzers in a quiz game) a

10条回答
  •  渐次进展
    2020-11-30 22:57

    I found that Xcode sorts the collection alphabetically using the ID of the connection. If you open the version editor on your nib file you can easily edit the id's (making sure they are unique otherwise Xcode will crash).

    
    
    
    
    
    
    
    
    

    It helps if you first order your object manually in the Document Outline of IB so they show up in sequence in the the xml code.

提交回复
热议问题