Bold part of a UIButton title label
<p>I've tried a couple of different methods and extensions after coming across them on S.O. to no avail. Is there a definitive way to bold only part of a UIButton.titleLabel?</p>

<p>These are some of the extensions I've tried: </p>

<pre><code>func attributedText(fullStr: String, boldStr: String) -&gt; NSAttributedString {

                let attributedString = NSMutableAttributedString(string: fullStr as String, attributes: [NSFontAttributeName:UIFont.systemFontOfSize(12.0)])

                let boldFontAttribute = [NSFontAttributeName: UIFont.boldSystemFontOfSize(12.0)]

                // Part of string to be bold
                attributedString.addAttributes(boldFontAttribute, range: NSMakeRange(0, boldStr.characters.count))


               return attributedString
}


func boldRange(range: Range&lt;String.Index&gt;) {
                if let text = self.attributedTitleForState(UIControlState.Normal) {
                    let attr = NSMutableAttributedString(attributedString: text)
                    let start = text.string.startIndex.distanceTo(range.startIndex)
                    let length = range.startIndex.distanceTo(range.endIndex)
                    attr.addAttributes([NSFontAttributeName: UIFont.boldSystemFontOfSize(16)], range: NSMakeRange(start, length))
                    self.setAttributedTitle(attr, forState: UIControlState.Normal)
                }
}


func boldSubstring(substr: String) {
                let range = substr.rangeOfString(substr)
                if let r = range {
                    boldRange(r)
                }
}
</code></pre>

<p>Anyone have anything?</p>