Try this:
let imagePlaceholder = "[ImagePlaceholder]"
let fullString = String(format: "Hello %@", imagePlaceholder)
let attributes: [NSAttributedStringKey: Any] = [.font: UIFont.systemFont(ofSize: 16), .foregroundColor: UIColor.white]
let attributedString = NSMutableAttributedString(string: fullString, attributes: attributes)
if let imagePlaceholderRange = fullString.range(of: imagePlaceholder) {
let range = NSRange(imagePlaceholderRange, in: fullString)
let attachment = NSTextAttachment()
let myImage = UIImage(named: "MyImage")
attachment.image = myImage
let stringAttachment = NSAttributedString(attachment: attachment)
attributedString.replaceCharacters(in: range, with: stringAttachment)
}
myLabel.attributedText = attributedString