Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display superscript asterisk in UIlabel

Tags:

unicode

iphone

I want to display asterisk symbol as superscript in my application. Is there any Unicode value for this?

like image 749
Lena Avatar asked Jun 07 '12 13:06

Lena


People also ask

How do you add a superscript in Swift?

Create a NSMutableAttributedString with the full string and default font. Add an attribute to the characters you want to change ( NSRange ), with the smaller/subscript UIFont , and the NSBaselineOffsetAttributeName value is the amount you want to offset it vertically. Assign it to your UILabel.

What is UILabel?

A view that displays one or more lines of informational text.


2 Answers

In Swift version, simply copy this asterisk sign and paste in your string or UILabel text.

E.g. lblTest.text = "This is required field ⃰

This might help some other people who are seeking to put the asterisk sign in a simple string.

like image 162
Bhavin_m Avatar answered Oct 18 '22 15:10

Bhavin_m


As per http://unicode.org/mail-arch/unicode-ml/Archives-Old/UML017/0066.html, there's no such thing as a "Superscript Asterisk" character in Unicode.

like image 43
Cyrille Avatar answered Oct 18 '22 14:10

Cyrille