What is the XCode Interface Builder “Document” Sec

2019-03-26 23:07发布

I understand the "Xcode Specific Label" section.

What I don't understand is the "Notes" section. I've played around with it and can't see any discernable effect.

Can anyone explain this?

enter image description here

1条回答
来,给爷笑一个
2楼-- · 2019-03-26 23:39

It's saving an attributed string with a key of userComments to the storyboard file.

<attributedString key="userComments">
    <fragment content="These are the comments I entered in the notes section of Interface Builder">
        <attributes>
            <font key="NSFont" size="11" name="LucidaGrande"/>
            <paragraphStyle key="NSParagraphStyle" alignment="left" lineBreakMode="wordWrapping" baseWritingDirection="natural"/>
        </attributes>
    </fragment>
</attributedString>

I don't know of any practical use of this, though. It would be nice to be able to retrieve this programmatically, though.

查看更多
登录 后发表回答