I want to set the name as bold in the string for the label with my custom font what I want:
"Hi Gaurav"
for this I have used the following code
let attrs = [NSAttributedString.Key.font : UIFont.boldSystemFont(ofSize: CGFloat(studentnameFontSize))]
let attributedStringStudenatName = NSMutableAttributedString(string:"Gaurav", attributes:attrs)
let normalText = "Hi "
let normalString = NSMutableAttributedString(string:normalText)
normalString.append(attributedStringStudenatName)
myLabel?.attributedText = normalString
but I want to use my custom font rather than systemFont: let attrs = [NSAttributedString.Key.font : UIFont.boldSystemFont(ofSize: CGFloat(studentnameFontSize))]