Horje
bold world in text swift Code Example
how to bold 1 word swift
extension String {
func withBoldText(text: String, font: UIFont? = nil) -> NSAttributedString {
  let _font = font ?? UIFont.systemFont(ofSize: 14, weight: .regular)
  let fullString = NSMutableAttributedString(string: self, attributes: [NSAttributedString.Key.font: _font])
  let boldFontAttribute: [NSAttributedString.Key: Any] = [NSAttributedString.Key.font: UIFont.boldSystemFont(ofSize: _font.pointSize)]
  let range = (self as NSString).range(of: text)
  fullString.addAttributes(boldFontAttribute, range: range)
  return fullString
}}


// USE CASE:
       let text = "Discover New Shops.".withBoldText(text: "New")
       label.attributedText =  headerTitle

        
bold world in text swift
Text("Bold text").bold() + Text("normal text")




Swift

Related
how to print body moya swift Code Example how to print body moya swift Code Example
transform string to url swift Code Example transform string to url swift Code Example
protocol oriented programming swift github Basic Code Example protocol oriented programming swift github Basic Code Example
swift paged scrollview get current page Code Example swift paged scrollview get current page Code Example
swift md5 cryptokit Code Example swift md5 cryptokit Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7