ui lable with icon to the left code example
Example: ui lable with icon to the left
let labelLeft = SMIconLabel(frame: CGRect(x: 10, y: 10, width: view.frame.size.width - 20, height: 20))
labelLeft.text = "Icon on the left, text on the left"
// Here is the magic
labelLeft.icon = UIImage(named: "Bell") // Set icon image
labelLeft.iconPadding = 5 // Set padding between icon and label
labelLeft.numberOfLines = 0 // Required
labelLeft.iconPosition = (.left, .top) // Icon position
view.addSubview(labelLeft)