You don't need to rely on special characters, you just need to adjust the baseline of the exponent section of the string so that it is superscripted.
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:@"ten to the power of 2 = 10"];
NSDictionary *exponentAttributes = @{
NSForegroundColorAttributeName : [UIColor redColor],
NSBaselineOffsetAttributeName : @(8)
};
NSAttributedString *exponentAttributedString = [[NSAttributedString alloc] initWithString:@"2" attributes:exponentAttributes];
[attributedString appendAttributedString:exponentAttributedString];
triggerLabel.attributedText = attributedString;
You can tweak this to parse and build strings using your provided markup - the approach is the important part. You'll probably want to specify a smaller font too with NSFontAttributeName
.