in the attribute inspector i have a placeholder (a.k.a a hint) for a textfield. The hint is called USERNAME. I'd like to localize this. I have already added the necessary strings into a localizable.strings file. My question is i would rather reference this string from the inspector itself. I wish i could do something like localstrings(#"username") right inside the placeholder field itself. I wish i could localize the placeholder string directly from interface builder is what i'm asking for. I've attached an image showing what i'd like to accomplish.
Localize your storyboard(Main.storyboard), Xcode makes strings file(Main.storyboard) for you, so edit it like...
"XXXXXXX.placeholder" = "NOMBRE";
Related
I have a link within an attributed string that is being then set for a textview. For Accessibility purpose, I want that link to be called out as a link trait, is it currently possible for an attributed string to call out different traits within the string? If not what could be an ideal solution to do that then?
You can look for all the "style runs" of attributes within the text view's attributed text by calling attributes(at:longestEffectiveRange:in:) repeatedly until you come to the style run you want. Thus you can locate the link and obtain its value.
Refer to this prior question/answer combo of mine. It's describing how to create a property editor for the IDE.
I've created another property editor for a completely different purpose. In this case, it's a glyph character selector of type String (because it could contain more than one glyph character). Unlike my other one in mentioned question/answer, this one is very specific to a particular property on a particular TCollectionItem class of mine.
All is good, and I can invoke this property editor for this particular property. However, I have a dilemma. The property editor, by nature, is directly related to a font. The user may choose a character (glyph) from a particular font. My property editor has the facility to change the font, and browse the glyphs contained within that font.
This component of mine also has the facility to specify the font, in a separate TFont property. The problem arises when it comes to the combination of both my Glyph property and Font property being used in the very same property editor. When I invoke this editor for the Glyph property, it also needs to know the Font which it needs to use. On the contrary, when user chooses a font and glyph character in this editor, it also needs to update both the Glyph and Font properties.
Long story short, PropertyB depends on PropertyA. If PropertyA changes, then PropertyB will have an entirely different set of possible values. So, whatever editor I install in the IDE needs to allow the user to change both PropertyA and PropertyB at the same time.
How can I make a property editor have access to more than one property?
TPropertyEditor has a public GetComponent() method that you can use to access the object(s) whose property is currently being edited (multiple objects with the same property can be edited at the same time, if the property editor allows it). Then you will have access to all of the other properties in the same object(s).
That being said, if your editor displays a pop-up dialog for editing, it should be implemented as a component editor instead of (or in addition to) a property editor. A property editor should edit only one property at a time, though it may have read-only dependancies on other properties. For instance, a Glyph property editor that also edits the Font property, and vice versa, is not a good design. But a component editor that edits both is perfectly acceptable.
Solution 1
Instead of a property editor, implement a component editor. Such a component editor will have access to the entire component, not just a single property.
Solution 2
Wrap both of your properties inside of a dedicated TPersistent class, and then create a TClassProperty property editor for this class instead. The individual properties will not actually invoke a property editor. Instead, their parent TPersistent will invoke a combined property editor which has access to all the properties within this class. A good existing example is the TFont editor.
What is the Document section when selecting the Identity inspector in any view.
Specially what are these squares with different colors for?
The whole Identity section of the identity inspector exists to make things more convenient for you in Xcode.
The Label field identifies the UI element in Xcode.Suppose you have three text fields in your window. Giving each text field a different label makes it easier to identify each text field.
Here is an example, create two UIViews in Storyboard, and use Label to identify each(Clarify: You can't refer to UI element by its label, Label is just for convenience):
The color label looks quite similar to color labels in operating system, but I haven't figure out how to use it in Xcode yet.
The note section give an attributed string with a key of userComments to the storyboard file. For the usage of note section, this post may helphow-to-add-copyright-information-to-a-nib-file
I want to add font image to and UILabel. I added new TTF file to my resource folder which is fontallo. Added project info Fonts fontallo.ttf.
Now I want to set those images which are inside the fontallo.
Please find the below images
[lbl_FontImage setFont:[UIFont fontWithName:#"fontello" size:30]];
Unable to set those image to UILabel. Need suggestion to resolve it.
I'm assuming that you have verified the font is loaded and set onto the label. If not you need to log all of the fonts loaded in the system, check it's there and find the correct font name to pass to UIFont.
You need to set the label text to a string containing the character you want. You generally need to know the character that the font is using, kind of like the location in the font file. Or, you can copy the character (from FontBook) directly into your code (though you might see a placeholder symbol in the code).
I'd say it's generally best not to copy and paste, but that's probably personal preference. Unicode is better to use. To get that you need a tool which will tell you the Unicode value of the character. Once you have that you can create the string and directly reference the character.
Make sure you add your font names to your project's .plist file:
I have added settings.bundle to my app,i'm displaying a textfield with title using settings.bundle in settings,but I need insert/add a placeholder to textfield, is it possible in settings.bundle,if yes,please help me how?
No, currently settings.bundle does not allow you to add placeholder text for text field. The text field type displays a title (optional) and an editable text field. You can use this type for preferences that require the user to specify a custom string value.
There are some preference control types that are allowed.
Follow this: LINK