Superscript "Registered mark" in UIPickerView - ios

I need to show a registered trademark symbol in a superscript (exponent position) in respect to the name of the label. need to show it in a uipickerView and a label. I havent found the option of how to show the unicode \u00AE in the exponent position,
1) Should I use 2 labels in different positions in the uipickerView?
2) Or, Show an image in the picker view with the intended name?
Thanks a lot!

For me this works:
#"Sometext \u00AE other text".
Can you check?

The unicode symbol is very slightly superscripted but I guess this isn't enough for you. You can't mix font sizes and styles within a label so there isn't an easy answer. Two labels probably won't work because you will be having to adjust the position of the R sign.
The simplest answer is probably to subclass UILabel and, in the drawRect method, call the super implementation and then manually draw the R string where you want it. You can get the size of the existing text using the NSString drawing methods so you'll know where to put the symbol.

I ended up using an image in the picker view to show the superscript as needed,
inspired by the catalog app from apple,
if you are a noob like me and would like to check the project, please go to
project in Github

Related

Format UILabel with image and links

How can I add a string with link and image in a UIlabel using swift code.
Below is a sample what I needed:
Visit to the following link Terms and conditions 💼 for specific
instructions.
I need the Terms and conditions and the bag in red collar and remaining text in grey color. Tapping on red coloured text opens a link.
Anyone please help.
The short answer is, don't do that. A UILabel displays a string. That's what it's made to do. Adding images and links to a label is stretching it well beyond its intended purpose.
You can take a generic UIView and add subviews for your text and your image(s). Build your desired contents out of the elements you need.
I would suggest using a UITextView since that supports clickable links. Set it's editable flag to false and turn on link detection.
As per your problem described here. I have found a perfect solution, as per your requirement.
Here is the link to your solution : Link
You can try this and bridge it as it's written in Objective-C
KILabel
I solved it by adding an attributed text and user interaction to handle link tap. To add image NStextAttachment can be used. Write method to handle tap gesture for label using range.

Customized ios keyboard

I need a customized keyboard. Only certain certain letters should be in the keyboard. I guess this is quite easy. The problem is that I need each tangent to basically contain 2 characters.
Lets say that each letter has a value. So for the letter A that has a value of 1 I also need to display that number in the same tangent. I would be like 70-80% of all the space would be taken by the letter A and (maybe at the bottom, right aligned) there would be a little number.
I guess this is not possible to do by using and customizing the default keyboard right? What would you suggest? Thanks.
considering you requirements you got nothing to do with the default keyboard...
create a UIView with buttons for the keys and use it wherever you like.
Godd Luck,

Word Wrapping on UILabel iOS

Hi friends i have one requirement that word wrapping on label. Using myLabel.lineBreakMode=NSLineBreakByCharWrapping;
I am able to show the text in label like below
Designation : I am working as iOS
Developer
But i want to show
Designation : I am working as iOS
Developer
Is this possible to achieve above requirement within one label?
Thanks
I tried it and got it solved. I have attached the screenshot. You just need to do the following:
set lines property of label to 2.
set height and width of the label through xib and its done.
In Xcode, you can design your UILabel to have 2 lines. Then, you just need to add a new line ("\n") after the word "iOS", and center-align everything? If your caption is always the same you can pre-enter it in Xcode. To add a new line, just press alt+Enter.
Would that be acceptable?
No, it's not possible with UILabel, Unless workaround to this. I think, you know how to done manually. But You can't wrap the content like above. Simple answer is you can use two label.
Not possible. UILabel just renders text according to properties that you defined. If you want to do it ideally then use two UILabels. & Place them according to your need.

UITextView with emoticons editing

I am developing xmpp-client app. One of the features is sending smiles and user should have ability to edit its like usuall text. Emoticons editing in Viber App is best example of what i want to implement.
I already tried three ways to solve problem:
I create emoticon like usual UIImageView and place it as a subview on UITextView using current caret rect. I use 5 whitespaces as a text placeholder in text view. There are two problems: with placing emoticons on new line when inserting text in the middle(printing whitespace not make caret move to new line); when user placing caret using magnify glass, he can move caret through emoticon(through 5 whitespaces), as delegate method not called during this process.
I have tried EGOTextView. There are problems with caret position and resizing when new line should be added. And there are some rendering artifacts when using it one line size.
I also have tried using UIWebView. But there were great problems with resizing based on text size and other artifacts with speed of response when becoming first responder.
May be some one could give me advice of really working solution?
I'm not really into rects and ranges mechanism of UITextView/UITextInput, but I try to give you an (untested) advice that maybe could achieve the expected result.
Built-in iOS emojis are simple characters, so we can follow the same path by building a custom font (or extend an existing one).
We have two options:
If you want to target iOS 6.0 (that has native support for NSAttributedString in UIKit classes), you could try to build a custom font containing all the emoticons you need, and use it inside your NSAttributedString (attributed string can mix different fonts, font sizes, styles and so on).
You could do something similar with iOS 5, but since you can't use NSAttributedString inside UITextView (so you are limited to just one font for the entire text) you should use a font that combines together the actual characters and the custom emoticons: so you should extend the font you want to use for typing, by adding all the emoticons to it. I don't know if this could have licenses implications, anyway.
Otherwise, you could always go much more low-level, implementing your own custom textView using CoreText, but I think it would be a hard work.

Is it possible to customize a text field , in iOS?

i am in need to use a text field in my application but the ones provided by XCode are only 1 line long and you can only change the width but not the hight.
I was wondering if its possible to make it look more lines long?
Is it only possible with customization and if yes any good tutorials?
Thank you!
First off, you can actually change the height of a UITextField. Just change the border style in the Attributes Inspector to anything except the default "rounded corners". You can then resize it right in Interface Builder. If you really wanted to, you could even change it back in your viewDidLoad method like this:
self.myTextField.borderStyle = UITextBorderStyleRoundedRect;
However, to have multiple lines, you have to use a UITextView. It's by default multi-line, but see the Apple documentation for more information.
You can use a UITextView. The document about it here. If you need something else, please post an image of what you want to achieve.

Resources