CopyPastor

Detecting plagiarism made easy.

Score: 1; Reported for: Exact paragraph match Open both answers

Possible Plagiarism

Plagiarized on 2020-05-08
by Swaraag

Original Post

Original - Posted on 2016-04-07
by Joe Benton



            
Present in both answers; Present only in the new answer; Present only in the old answer;

Maybe you could look at this post, which already has (accepted): https://stackoverflow.com/questions/36486761/make-part-of-a-uilabel-bold-in-swift
Please tell me if that helps!
This was the accepted answer - if you would want it:
You will want to use attributedString which allows you to style parts of a string etc. This can be done like this by having two styles, one normal, one bold, and then attaching them together:

let boldText = "Filter:" let attrs = [NSAttributedString.Key.font : UIFont.boldSystemFont(ofSize: 15)] let attributedString = NSMutableAttributedString(string:boldText, attributes:attrs) let normalText = "Hi am normal" let normalString = NSMutableAttributedString(string:normalText) attributedString.append(normalString)
When you want to assign it to a label:
label.attributedText = attributedString
You will want to use `attributedString` which allows you to style parts of a string etc. This can be done like this by having two styles, one normal, one bold, and then attaching them together:

let boldText = "Filter:" let attrs = [NSAttributedString.Key.font : UIFont.boldSystemFont(ofSize: 15)] let attributedString = NSMutableAttributedString(string:boldText, attributes:attrs) let normalText = "Hi am normal" let normalString = NSMutableAttributedString(string:normalText) attributedString.append(normalString) When you want to assign it to a label: label.attributedText = attributedString

        
Present in both answers; Present only in the new answer; Present only in the old answer;