TAGS :Viewed: 6 - Published at: a few seconds ago

[ HTML string in UITextView AppStore rejection ]

HTML string may be represented in a UITextView using NSAttributedString, like so,

NSAttributedString(data: html.dataUsingEncoding(NSUTF8StringEncoding)!, options: [NSDocumentTypeDocumentAttribute : NSHTMLTextDocumentType, NSCharacterEncodingDocumentAttribute: NSUTF8StringEncoding], documentAttributes: nil, error: nil)!

I also tried an alternate way to go about this.

func convertHTMLstring(text: UITextView, HTMLString: NSString)
{
    text.setValue(HTMLString, forKey: "contentToHTMLString")
}

The question is in two parts; is there a possibility of the app getting rejected for AppStore if I use the alternate way to display HTML string in UITextView? Also, when the cleaned, readable text is displayed on the UITextView, the font size gets overridden. In my case, it becomes smaller than specified. Is there a way to resolve this?

Answer 1


Part 1 - App Store rejection will only be because of one of the reasons in the App Review Guidelines. There's plenty to worry about there without considering how you format some text. But I doubt your text formatting alone would get you rejected.

Check this and read it carefully: https://developer.apple.com/app-store/review/guidelines/

Part 2 - Is it a UITextField or a UITextView. If your text is getting smaller than you've set in a UITextField it's probably because you have adjustsFontSizeToFitWidth set to YES and the text is wider than the text field. Fixing that would require us to see more of you code and maybe a screenshot.

If it's a UITextView check this answer: How to change the uitextview font size. See if you have it set to "Selectable" in the storyboard.

But you might want to make it just a label.