What is the purpose of 'Notes' under Docum

2020-05-27 04:28发布

问题:

There is a free text field under the font selection box in Xcode 5. It seems to belong to the Notes category. So: What is the purpose of Notes and the empty box under No Font shown in the image below?

回答1:

Finally it does something in Xcode 7!

In Xcode 7, Document Notes get exported to the Storyboard.strings file, and thus to XLIFF localization files.



回答2:

I have tried to use notes for one of my component i.e a button for me and added some notes for it as in the image 1.

Here is the xml file for the button in XIB ,where you can see it is a comment used for user reference.



回答3:

you can identify description for your widget using this field which I understand, it's documentation purpose so any one can understand your widgets by looking your xib.



回答4:

The whole "Document" box is just there to help organise your objects in the Storyboard. You can give it a label, so you can easily identify it in the "Scene" list among others.

The Notes, unspectacularly, look like they are just your "notes" about the object, a helper textbox where you can write information that can help you (or someone looking at your project) better understanding what the interface element is for.

Think about it as a "//" comment, but just for visual elements on the Storyboard.



回答5:

The short answer for notes:- It is a textfield inside identity inspector which allow you to add note for UIElements. It has nothing to do much with your object. For example, lets say you have created some 5 textfield and among this one textfield contains numberformatter. Lets say drag and drop textfield and then put numberformatter over textfield. In IB it is not possible to see that numberformatter over textfield. So such kind of scenarios to identify in which object changes are there. Notes textfield will be useful, So for better recognizing we can use notes to identify change on that particular object.



回答6:

They are for notes. Possibly for localization notes to add description to the thing. Possibly for the same kind of thing you do with code comments.



回答7:

I just sharing with i think about it and Can edit and modify the answer so what i think the Purpose will be like if you want to hold the information about the View Objects and you don't want to add a new object in your xib for only to hold this information, you could just add your copyright notice into the File's Owner -> Document -> notes field. Also can be used for the Documentation purpose. And this information also will be included in the xml.

And As i also learn form this SO Questions It's saving an attributed string with a key of userComments to the storyboard file.